What’s New In Xamarin.Forms 1.3 Craig Dunn craig@xamarin.com
What’s new in 1.3? 1. New App class 2. Font Properties 3. Styles 4. Triggers 5. Behaviors 6. Navigation Stack and a lot more…
New Application Class 1/2 • MainPage property • Can be expressed as XAML • Provides a shared ResourceDictionary for the entire app Styles! The old way The new way Application base set MainPage
New Application Class 2/2 • Application lifecycle:  OnStart  OnSleep  OnResume • Properties dictionary (persists across app re-starts) NOTE: beware of existing App class in Windows Phone projects.
Font refactoring • The deprecated Font property was difficult to databind (face, size, style too tightly coupled) • Replaced by:  FontFamily  FontSize  FontAttributes • Use GetNamedSize() to resolve NamedSize enum
Styles 1/3 • You could previously add objects to a ResourceDictionary, and reference with {StaticResource} The old way
Styles 2/3 • You could always add properties to a ResourceDictionary, and reference with {StaticResource} • Now you can group into a Style and share! • Can also be added to App-level ResourceDictionary
Styles 3/3 • DynamicResource behave like data- binding, and support Apple’s Dynamic Type (size) rendering • Triggers & Behaviors can be added to styles
Triggers 1/3 • Visual Elements can react to events and property changes • “conditional style” - CP • Can be added in C# • Types:  Trigger  EventTrigger  DataTrigger  MultiTrigger OR OR
Triggers 2/3 • The EventTrigger has Event instead of Property • TriggerAction is written in C# • Remember xmlns:
Triggers 3/3 • DataTriggers can bind to other controls (Binding instead of Property)
Behaviors 1/2 • Add functionality to visual elements without subclassing
Behaviors 2/2 • Add functionality to visual elements without subclassing • Can participate in data-binding
Navigation Stack • Allow editing of the stack beyond push/pop off the top • New features:  RemovePage  InsertPageBefore  NavigationStack[] • Animation can be disabled! InsertPageBefore RemovePage Push/Pop
Other highlights • Page.OnBackButtonPressed to allow intercepting physical back button • Map.Pin response to Clicked after bubble is displayed • Star (*) is the default grid size • ListView has context-actions (eg. side-swipe buttons in iOS) Release Notes: http://forums.xamarin.com/discussion/29934/xamarin-forms-1-3-0-released/p1 • MasterDetailPage now has  ShouldShowToolbarButton  MasterBehaviour • iOS 64-bit support see the release notes for more!
Questions? Craig Dunn craig@xamarin.com http://developer.xamarin.com/guides/cross-platform/xamarin-forms/ https://github.com/xamarin/xamarin-forms-samples WorkingWith Fonts, Styles, Triggers, Behaviors, Navigation

What's New Xamarin.Forms 1.3

  • 1.
    What’s New In Xamarin.Forms1.3 Craig Dunn craig@xamarin.com
  • 2.
    What’s new in1.3? 1. New App class 2. Font Properties 3. Styles 4. Triggers 5. Behaviors 6. Navigation Stack and a lot more…
  • 3.
    New Application Class1/2 • MainPage property • Can be expressed as XAML • Provides a shared ResourceDictionary for the entire app Styles! The old way The new way Application base set MainPage
  • 4.
    New Application Class2/2 • Application lifecycle:  OnStart  OnSleep  OnResume • Properties dictionary (persists across app re-starts) NOTE: beware of existing App class in Windows Phone projects.
  • 5.
    Font refactoring • Thedeprecated Font property was difficult to databind (face, size, style too tightly coupled) • Replaced by:  FontFamily  FontSize  FontAttributes • Use GetNamedSize() to resolve NamedSize enum
  • 6.
    Styles 1/3 • Youcould previously add objects to a ResourceDictionary, and reference with {StaticResource} The old way
  • 7.
    Styles 2/3 • Youcould always add properties to a ResourceDictionary, and reference with {StaticResource} • Now you can group into a Style and share! • Can also be added to App-level ResourceDictionary
  • 8.
    Styles 3/3 • DynamicResourcebehave like data- binding, and support Apple’s Dynamic Type (size) rendering • Triggers & Behaviors can be added to styles
  • 9.
    Triggers 1/3 • VisualElements can react to events and property changes • “conditional style” - CP • Can be added in C# • Types:  Trigger  EventTrigger  DataTrigger  MultiTrigger OR OR
  • 10.
    Triggers 2/3 • TheEventTrigger has Event instead of Property • TriggerAction is written in C# • Remember xmlns:
  • 11.
    Triggers 3/3 • DataTriggerscan bind to other controls (Binding instead of Property)
  • 12.
    Behaviors 1/2 • Addfunctionality to visual elements without subclassing
  • 13.
    Behaviors 2/2 • Addfunctionality to visual elements without subclassing • Can participate in data-binding
  • 14.
    Navigation Stack • Allowediting of the stack beyond push/pop off the top • New features:  RemovePage  InsertPageBefore  NavigationStack[] • Animation can be disabled! InsertPageBefore RemovePage Push/Pop
  • 15.
    Other highlights • Page.OnBackButtonPressedto allow intercepting physical back button • Map.Pin response to Clicked after bubble is displayed • Star (*) is the default grid size • ListView has context-actions (eg. side-swipe buttons in iOS) Release Notes: http://forums.xamarin.com/discussion/29934/xamarin-forms-1-3-0-released/p1 • MasterDetailPage now has  ShouldShowToolbarButton  MasterBehaviour • iOS 64-bit support see the release notes for more!
  • 16.

Editor's Notes

  • #10 SETTERS
  • #13 Make a conscious choice whether to include formatting such as the colon in the string.