what's new xamarin.forms 1.3

16
What’s New In Xamarin.Forms 1.3 Craig Dunn [email protected]

Upload: craig-dunn

Post on 16-Jul-2015

848 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: What's New Xamarin.Forms 1.3

What’s New In

Xamarin.Forms 1.3

Craig Dunn

[email protected]

Page 2: What's New Xamarin.Forms 1.3

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

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

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

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

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

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

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

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

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

Triggers 3/3

• DataTriggers can bind to other controls (Binding instead of Property)

Page 12: What's New Xamarin.Forms 1.3

Behaviors 1/2

• Add functionality to visual elements without subclassing

Page 13: What's New Xamarin.Forms 1.3

Behaviors 2/2

• Add functionality to visual elements without subclassing

• Can participate in data-binding

Page 14: What's New Xamarin.Forms 1.3

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

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

Questions?

Craig Dunn

[email protected]

http://developer.xamarin.com/guides/cross-platform/xamarin-forms/

https://github.com/xamarin/xamarin-forms-samples

WorkingWith Fonts, Styles, Triggers, Behaviors, Navigation