Top Banner
#XamarinDevDays
32

2 xamarin.forms

Jan 13, 2017

Download

Technology

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 2   xamarin.forms

#XamarinDevDays

Page 2: 2   xamarin.forms
Page 3: 2   xamarin.forms
Page 4: 2   xamarin.forms

Traditional Xamarin

Approach

With Xamarin.Forms:

More code-sharing, all native

iOS C# UI Windows C# UIAndroid C# UI

Shared C# Backend

Shared UI Code

Shared C# Backend

Page 5: 2   xamarin.forms

✓ 40+ Pages, layouts, and controls

(Build from code behind or XAML)

✓ Two-way data binding

✓ Navigation

✓ Animation API

✓ Dependency Service

✓ Messaging Center

Shared C# Backend

Shared UI Code

Page 6: 2   xamarin.forms

Layouts

Pages

Stack Absolute Relative Grid ContentView ScrollView Frame

Content MasterDetail Navigation Tabbed Carousel

Page 7: 2   xamarin.forms

ActivityIndicator BoxView Button DatePicker Editor

Entry Image Label ListView Map

OpenGLView Picker ProgressBar SearchBar Slider

Stepper TableView TimePicker WebView EntryCell

ImageCell SwitchCell TextCell ViewCell

Page 8: 2   xamarin.forms

Xamarin.Forms Ecosystem

Page 9: 2   xamarin.forms

Windows Xamarin.Forms

StackPanel StackLayout

TextBox Entry

ListBox ListView

CheckBox Switch

ProgressBar ActivityIndicator

Grid Grid

Label Label

Button Button

Image Image

Date/TimePicker Date/TimePicker

Page 10: 2   xamarin.forms

Windows Xamarin.Forms

DataContext BindingContext

{Binding Property} {Binding Property}

ItemsSource ItemsSource

ItemTemplate ItemTemplate

DataTemplate DataTemplate

Page 11: 2   xamarin.forms
Page 12: 2   xamarin.forms

<?xml version="1.0" encoding="UTF-8"?>

<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"

xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"x:Class="MyApp.MainPage">

<TabbedPage.Children>

<ContentPage Title="Profile" Icon="Profile.png">

<StackLayout Spacing="20" Padding="20"

VerticalOptions="Center">

<Entry Placeholder="Username"

Text="{Binding Username}"/>

<Entry Placeholder="Password"

Text="{Binding Password}"

IsPassword="true"/>

<Button Text="Login" TextColor="White"

BackgroundColor="#77D065"

Command="{Binding LoginCommand}"/>

</StackLayout>

</ContentPage>

<ContentPage Title="Settings" Icon="Settings.png">

<!-- Settings -->

</ContentPage>

</TabbedPage.Children>

</TabbedPage>

Page 13: 2   xamarin.forms
Page 14: 2   xamarin.forms
Page 15: 2   xamarin.forms

Xamarin.Formsis Open Source!

open.xamarin.com

Page 16: 2   xamarin.forms
Page 17: 2   xamarin.forms

✓ Improves scrolling performance

✓ Old behavior is currently the default (but likely to change)

Page 18: 2   xamarin.forms
Page 19: 2   xamarin.forms

XAML

Parsed and inflated

Parsed & turned

into IL

XAMLC

Page 20: 2   xamarin.forms
Page 21: 2   xamarin.forms

✓ Faster Loading

✓ Smaller App Size

✓ See XAML errors at build time

Page 22: 2   xamarin.forms
Page 23: 2   xamarin.forms
Page 24: 2   xamarin.forms

• Embeddable

Carousel

• ItemTemplate &

DataTemplates

• Highly customizable

& Virtualized

Page 25: 2   xamarin.forms
Page 26: 2   xamarin.forms
Page 27: 2   xamarin.forms
Page 28: 2   xamarin.forms

https://developer.xamarin.com/guides/xamarin-forms/datapages/

Page 29: 2   xamarin.forms

https://developer.xamarin.com/guides/xamarin-forms/themes/

Page 30: 2   xamarin.forms

Native Embedding

Page 31: 2   xamarin.forms
Page 32: 2   xamarin.forms

10 Minute Break

Nicolò Carandini

@TPCWare

Microsoft MVP

[email protected] blog.tpcware.com @TPCWare