Xamarin.Forms 1.3 introduces several new features including a new Application class, font properties, styles, triggers, behaviors, and enhancements to navigation. The Application class now supports application lifecycle methods, a MainPage property, and resource dictionaries. Fonts can now be specified via font family, size, and attributes instead of a single font property. Styles allow grouping of properties and resources. Triggers and behaviors add interactivity and functionality without subclassing. Navigation features like removing and inserting pages are added.
2. 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…
3. 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
4. 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.
5. 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
6. Styles 1/3
• You could previously add objects to a
ResourceDictionary, and reference
with {StaticResource}
The old way
7. 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
8. Styles 3/3
• DynamicResource behave like data-
binding, and support Apple’s Dynamic
Type (size) rendering
• Triggers & Behaviors can be added
to styles
9. 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
10. Triggers 2/3
• The EventTrigger has Event
instead of Property
• TriggerAction is written in
C#
• Remember xmlns:
13. Behaviors 2/2
• Add functionality to visual elements
without subclassing
• Can participate in data-binding
14. 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
15. 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!