interfaces nativas cross-platform con xamarin.forms

41
#XamarinDevDays

Upload: javier-suarez-ruiz

Post on 12-Jan-2017

1.422 views

Category:

Technology


2 download

TRANSCRIPT

PowerPoint Presentation

#XamarinDevDays

Visual Studio Technologies & Windows Platform Development MVP

Software Developer Plain ConceptsJavier Surez Ruiz

Blog: http://geeks.ms/blogs/jsuarezEmail: [email protected]: @jsuarezruiz

Javier Surez Ruiz@jsuarezruizInterfaces nativas Cross-Platform con Xamarin.Forms

Crear UIs nativas para iOS, Android, y Windows Desde un mismo archivo comn, compartido C#.Conoce Xamarin.Forms

Xamarin + Xamarin.FormsEnfoque tradicional de XamarinCon Xamarin.Forms:Ms cdigo compartido, todo nativo iOS C# UI Windows C# UIAndroid C# UI

Shared C# Backend

Shared UI CodeShared C# Backend

Qu se incluye? 40+ pginas, layouts, y controles (code behind o XAML) Two-way data binding Mavegacin API de animaciones Dependency Service Messaging Center

Shared C# Backend

Shared UI Code

6

LayoutsPginasStackAbsoluteRelativeGridContentViewScrollViewFrame

ContentMasterDetailNavigationTabbedCarousel

Inside of a page are layoutsA lot of options from something simple like a stack panel to complex and powerful grids

7

ActivityIndicatorBoxViewButtonDatePickerEditorEntryImageLabelListViewMapOpenGLViewPickerProgressBarSearchBarSliderStepperTableViewTimePickerWebViewEntryCellImageCellSwitchCellTextCellViewCellControles

You have more than 40 controls, layouts, and pages to mix and match from.These are all of the controls you have out of the box, you can of course create your own.What is unique is you get the native control and have access to it.Consider an Entry FieldOn iOS it is mapped to UITextFieldAndroid it is EditTextWindows Phoen it is a TextBox8

El ecosistema Xamarin.Forms

WindowsXamarin.FormsStackPanelStackLayoutTextBoxEntryListBoxListViewCheckBoxSwitchProgressBarActivityIndicatorGridGridLabelLabelButtonButtonImageImageDate/TimePickerDate/TimePicker

Comparativa de controles

10

WindowsXamarin.FormsDataContextBindingContext{Binding Property}{Binding Property}ItemsSourceItemsSourceItemTemplateItemTemplateDataTemplateDataTemplate

Comparativa de enlace a datos

11

Personalizacin de la plataforma

12

UI Nativa desde cdigo compartido

Xamarin.Forms

Demo

Qu hay nuevo?

Xamarin.Forms 2.0!

Xamarin.Formses Open Source!open.xamarin.com

Apple has a developer preview where Xamarin has alphas ready. Google does not offer this. Android versions are usually 4 to 8 weeks out for a stable release, but alphas and betas are usually earlier. Xamarin realizes how important having iOS ready because within 24 hours a large portion of iOS users upgradeAndroid on the other hand is much different. After 4 months on the market Android 4.4 only had 1% adoption

16

RendimientoRendimientoRendimiento

ListView CachingStrategy

Mejora el rendimiendo haciendo scroll El comportamiento antiguo es el usado por defecto

Compilacin XAMLXAML

RuntimeCompile-timeParsed and inflatedParsed & turned into IL

XAMLC

Beneficios Carga ms rapida Tamao de la App menor Ver errores XAML en tiempo de compilacin

Rendimiento

Demo

Diseo & Controles

Data Templates

Data Templates

Demo

CarouselViewCarouselItemTemplate & DataTemplatesAltamente personalizable & Virtualizado

CarouselView

Demo

Efectos I Custom renderer lite Cambia propiedades en el control nativo Opcional stringly-typed

X No mtodos o eventosX No reemplaza el control

A unique aspect of Xamarin.Forms is an abstraction over the user interface, but what about the platform specific functionality that makes these devices so special?

That is where plugins for Xamarin come in.27

Efectos IIentry.Effects.Add (Effect.Resolve("Xamarin.BorderEffect"));

A unique aspect of Xamarin.Forms is an abstraction over the user interface, but what about the platform specific functionality that makes these devices so special?

That is where plugins for Xamarin come in.28

Efectos

Demo

Y mucho ms!

XAML Previewer

Xamarin.Forms Previewer

Demo

Navegacin por URL

Connect Web to MobileSimple cross platform API over:CoreSpotlightNSUserActivityGoogle App Indexing

Navegacin por URL

Demo

Themes

https://developer.xamarin.com/guides/xamarin-forms/themes/

DataPages

https://developer.xamarin.com/guides/xamarin-forms/datapages/

DataPages

Demo

Native Embedding

Easily embed any native control into a Xamarin.Forms layout.

Native Embedding

Just add it as child to a layout.Exposed as an Extension Method.

Native Embedding

Demo

10 Minutos de descanso

JavierSurez [email protected]://javiersuarezruiz.wordpress.com@jsuarezruiz

2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.9/11/201641