What's New Xamarin.Forms 1.3
-
Upload
craig-dunn -
Category
Technology
-
view
850 -
download
1
Transcript of What's New Xamarin.Forms 1.3
![Page 2: What's New Xamarin.Forms 1.3](https://reader030.fdocuments.in/reader030/viewer/2022032616/55a6c00f1a28ab46688b47b2/html5/thumbnails/2.jpg)
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…
![Page 3: What's New Xamarin.Forms 1.3](https://reader030.fdocuments.in/reader030/viewer/2022032616/55a6c00f1a28ab46688b47b2/html5/thumbnails/3.jpg)
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
![Page 4: What's New Xamarin.Forms 1.3](https://reader030.fdocuments.in/reader030/viewer/2022032616/55a6c00f1a28ab46688b47b2/html5/thumbnails/4.jpg)
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.
![Page 5: What's New Xamarin.Forms 1.3](https://reader030.fdocuments.in/reader030/viewer/2022032616/55a6c00f1a28ab46688b47b2/html5/thumbnails/5.jpg)
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
![Page 6: What's New Xamarin.Forms 1.3](https://reader030.fdocuments.in/reader030/viewer/2022032616/55a6c00f1a28ab46688b47b2/html5/thumbnails/6.jpg)
Styles 1/3
• You could previously add objects to a ResourceDictionary, and reference with {StaticResource}
The old way
![Page 7: What's New Xamarin.Forms 1.3](https://reader030.fdocuments.in/reader030/viewer/2022032616/55a6c00f1a28ab46688b47b2/html5/thumbnails/7.jpg)
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
![Page 8: What's New Xamarin.Forms 1.3](https://reader030.fdocuments.in/reader030/viewer/2022032616/55a6c00f1a28ab46688b47b2/html5/thumbnails/8.jpg)
Styles 3/3
• DynamicResource behave like data-binding, and support Apple’s Dynamic Type (size) rendering
• Triggers & Behaviors can be added to styles
![Page 9: What's New Xamarin.Forms 1.3](https://reader030.fdocuments.in/reader030/viewer/2022032616/55a6c00f1a28ab46688b47b2/html5/thumbnails/9.jpg)
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
![Page 10: What's New Xamarin.Forms 1.3](https://reader030.fdocuments.in/reader030/viewer/2022032616/55a6c00f1a28ab46688b47b2/html5/thumbnails/10.jpg)
Triggers 2/3
• The EventTrigger has Eventinstead of Property
• TriggerAction is written in C#
• Remember xmlns:
![Page 11: What's New Xamarin.Forms 1.3](https://reader030.fdocuments.in/reader030/viewer/2022032616/55a6c00f1a28ab46688b47b2/html5/thumbnails/11.jpg)
Triggers 3/3
• DataTriggers can bind to other controls (Binding instead of Property)
![Page 12: What's New Xamarin.Forms 1.3](https://reader030.fdocuments.in/reader030/viewer/2022032616/55a6c00f1a28ab46688b47b2/html5/thumbnails/12.jpg)
Behaviors 1/2
• Add functionality to visual elements without subclassing
![Page 13: What's New Xamarin.Forms 1.3](https://reader030.fdocuments.in/reader030/viewer/2022032616/55a6c00f1a28ab46688b47b2/html5/thumbnails/13.jpg)
Behaviors 2/2
• Add functionality to visual elements without subclassing
• Can participate in data-binding
![Page 14: What's New Xamarin.Forms 1.3](https://reader030.fdocuments.in/reader030/viewer/2022032616/55a6c00f1a28ab46688b47b2/html5/thumbnails/14.jpg)
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
![Page 15: What's New Xamarin.Forms 1.3](https://reader030.fdocuments.in/reader030/viewer/2022032616/55a6c00f1a28ab46688b47b2/html5/thumbnails/15.jpg)
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!
![Page 16: What's New Xamarin.Forms 1.3](https://reader030.fdocuments.in/reader030/viewer/2022032616/55a6c00f1a28ab46688b47b2/html5/thumbnails/16.jpg)
Questions?
Craig Dunn
http://developer.xamarin.com/guides/cross-platform/xamarin-forms/
https://github.com/xamarin/xamarin-forms-samples
WorkingWith Fonts, Styles, Triggers, Behaviors, Navigation