building your first xamarin.forms app
TRANSCRIPT
university.xamarin.com
Deploy to
emulator and
device
Build native UIs for Android, iOS, and Windows
from a single, shared C# codebase
iOS
Traditional Xamarin shares
business logic
Xamarin.Forms can also share
the UI definition
iOS C# UI
Shared C# logic
Android C# UI Windows C# UI
iOS
Shared C# UI
Shared C# logic
✓ UI building blocks like pages, layouts, and controls
✓ XAML-defined UI
✓ Data binding
✓ Navigation
✓ Animation API
✓ Dependency Service
✓ Messaging Center
iOS
Shared C# UI
Shared C# logic
iOS
Android 4.0.3+iOS 6.1+ Windows 10 (UWP)
Windows Store 8.1 (RT)
Windows Phone 8.1 (RT)
Microsoft Visual Studio
on Windows
Visual Studio for Mac
on macOS (preview)
Parts of the build
are done on the
networked Mac
ContentPage MasterDetailPage NavigationPage TabbedPage CarouselPage
StackLayout AbsoluteLayout RelativeLayout Grid ContentView ScrollView Frame
Editor
Map
Slider
EntryCell
ActivityIndicator
Entry
OpenGLView
Stepper
ImageCell
BoxView
Image
Picker
TableView
SwitchCell
Button
Label
ProgressBar
TimePicker
TextCell
DatePicker
ListView
SearchBar
WebView
ViewCell
public class Person{
public string Name{
get; set;}
public string Email{
get; set;}
public Gender Gender{
get; set;}
}
Binding
Binding
Binding
Xamarin.FormsMicrosoft XAML (WinRT)
<?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">
<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">
</ContentPage>
</TabbedPage>
NuGet
Packages
Shared
Projects
Portable Class
Libraries
Open and pass
supported types
to PCL
Multiple options for passing data between platform-specific code and
shared (PCL) code
Platform-specific code strategies
Fill in properties
with loaded data
Design higher-
level abstractions
Get started todayxamarin.com/download
Free self-guided courses
@adrian_stevens
Samples available at:
aka.ms/drumpad