www dot NETcollege cz Xamarin Forms Je to

  • Slides: 37
Download presentation
www. dot. NETcollege. cz Xamarin Forms Je to vôbec použiteľné? Roman Jašek MSP roman.

www. dot. NETcollege. cz Xamarin Forms Je to vôbec použiteľné? Roman Jašek MSP roman. jasek@riganti. cz

Xamarin vs. Xamarin Forms i. OS C# UI Android C# UI Windows C# UI

Xamarin vs. Xamarin Forms i. OS C# UI Android C# UI Windows C# UI Shared C# Backend Xamarin Shared UI Code Shared C# Backend Xamarin Forms Viac zdieľaného kódu

Aktuálny stav ✓ 40+ stránok, layoutov, komponent Shared UI Code Shared C# Backend (XAML)

Aktuálny stav ✓ 40+ stránok, layoutov, komponent Shared UI Code Shared C# Backend (XAML) ✓ Data binding ✓ Navigácia ✓ Animácie. . .

Stránky Content Master. Detail Navigation Tabbed Carousel Stack Absolute Relative Grid Content. View Layouty

Stránky Content Master. Detail Navigation Tabbed Carousel Stack Absolute Relative Grid Content. View Layouty Scroll. View Frame

Komponenty Activity. Indicator Box. View Button Date. Picker Editor Entry Image Label List. View

Komponenty Activity. Indicator Box. View Button Date. Picker Editor Entry Image Label List. View Map Open. GLView Picker Progress. Bar Search. Bar Slider Stepper Table. View Time. Picker Web. View Entry. Cell Image. Cell Switch. Cell Text. Cell View. Cell

Komponenty tretích strán

Komponenty tretích strán

Rozdiely – názvy WPF Xamarin Forms Stack. Panel Stack. Layout Text. Box Entry List.

Rozdiely – názvy WPF Xamarin Forms Stack. Panel Stack. Layout Text. Box Entry List. Box List. View Check. Box Switch Progress. Bar Activity. Indicator Grid Label Button Image Date/Time. Picker

Rozdiely – Data Binding Windows Xamarin. Forms Data. Context Binding. Context {Binding Property} Items.

Rozdiely – Data Binding Windows Xamarin. Forms Data. Context Binding. Context {Binding Property} Items. Source Item. Template Data. Template Chýba mód One. Time

Grid, Stack. Layout • Prakticky rovnaké použitie ako vo WPF • Môžeme používať Grid

Grid, Stack. Layout • Prakticky rovnaké použitie ako vo WPF • Môžeme používať Grid v Android/i. OS? Awesome!

Table. View & List. View • Použitie vo formulároch, menu, štruktúrovaných dátach • Veľmi

Table. View & List. View • Použitie vo formulároch, menu, štruktúrovaných dátach • Veľmi jednoduché na použitie • Predpripravené typy buniek

Text. Cell

Text. Cell

Entry. Cell

Entry. Cell

Switch. Cell

Switch. Cell

Image. Cell

Image. Cell

View. Cell

View. Cell

List. View – problém 1 2 List. View na stránke Riešenie: • Repeater. View

List. View – problém 1 2 List. View na stránke Riešenie: • Repeater. View (XLabs)

List. View – problém 2 Horizontal List. View Riešenie: • Repeater. View (XLabs)

List. View – problém 2 Horizontal List. View Riešenie: • Repeater. View (XLabs)

Ladenie layoutu 1 • XAML Previewer • ALPHA!

Ladenie layoutu 1 • XAML Previewer • ALPHA!

Ladenie layoutu 2 • Gorilla Player • Server na PC • Klient v simulátore

Ladenie layoutu 2 • Gorilla Player • Server na PC • Klient v simulátore • Možnosť zobraziť priamo na telefóne • Použiteľné na základné ladenie layoutu • Nepodporuje custom komponenty

Intellisense • Extensions: – Enable XAML Language for Xamarin. Forms – Resharper

Intellisense • Extensions: – Enable XAML Language for Xamarin. Forms – Resharper

Data Binding Intellisense xmlns: d=http: //schemas. microsoft. com/expression/blend/2008 xmlns: mc=http: //schemas. openxmlformats. org/markupcompatibility/2006 mc:

Data Binding Intellisense xmlns: d=http: //schemas. microsoft. com/expression/blend/2008 xmlns: mc=http: //schemas. openxmlformats. org/markupcompatibility/2006 mc: Ignorable="d" d: Data. Context="{d: Design. Instance test: Test. View. Model}" 1. Nainstalovat XCC do projektu (Xaml Conditional Compilation) 2. Do. csproj přidat: <Xcc. Remove. Ignorable. Content>True</Xcc. Remove. Ignorable. Content> • Gorilla Player nepodporuje

Xamarin Studio • Na niektoré veci sa hodí • Už nie je distribuované •

Xamarin Studio • Na niektoré veci sa hodí • Už nie je distribuované • http: //download. xamarin. com/studio/Windo ws/Xamarin. Studio-6. 1. 0. 5383 -0. msi

Layoutové podivnosti 1 • Default spacing <Grid Column. Spacing="0" Row. Spacing="0"/>

Layoutové podivnosti 1 • Default spacing <Grid Column. Spacing="0" Row. Spacing="0"/>

Layoutové podivnosti 2 • Grid – automatické Rows/Columns <Grid> <Grid. Row. Definitions> <Row. Definition

Layoutové podivnosti 2 • Grid – automatické Rows/Columns <Grid> <Grid. Row. Definitions> <Row. Definition /> </Grid. Row. Definitions> <Label Grid. Row="0" Text="Test 1" /> <Label Grid. Row="1" Text="Test 2" /> <Label Grid. Row="2" Text="Test 3" /> </Grid>

Button Content • Tlačítko má len text Riešenia: 1. Priehľadné tlačítko nad Grid 2.

Button Content • Tlačítko má len text Riešenia: 1. Priehľadné tlačítko nad Grid 2. Gesture. Recognizers! (Tap, Pinch, Pan)

Platforme špecifické (1)

Platforme špecifické (1)

Platforme špecifické (2) • Navigácia na Activity/Storyboard • Dá sa navigovať oboma smermi

Platforme špecifické (2) • Navigácia na Activity/Storyboard • Dá sa navigovať oboma smermi

Custom Renderer • • Keď sa niečo nedá v XAML Platformne špecifické Vo Forms

Custom Renderer • • Keď sa niečo nedá v XAML Platformne špecifické Vo Forms projekte vyrobiť triedu V Android/i. OS projekte vyrobiť Renderer • [assembly: Export. Renderer(typeof(Border), typeof(Border. Renderer))]

Circle Image Border. Radius?

Circle Image Border. Radius?

Border • Frame –ak to nepotrebujete modifikovať • Inak Custom Renderer

Border • Frame –ak to nepotrebujete modifikovať • Inak Custom Renderer

Menu napravo

Menu napravo

Custom slider • Gradient • Vrstvy

Custom slider • Gradient • Vrstvy

SVG • Externé knižnice • Najjednoduchšie – custom font

SVG • Externé knižnice • Najjednoduchšie – custom font

Io. C • • • Autofac Ninject Simple. Injector Tiny. Io. C Mvvm. Cross

Io. C • • • Autofac Ninject Simple. Injector Tiny. Io. C Mvvm. Cross Unity • XLabs má wrapper nad kontajnermi

Pozitíva • • XAML!. Net Dokumentácia Zdieľanie kódu – 85 -90%

Pozitíva • • XAML!. Net Dokumentácia Zdieľanie kódu – 85 -90%

Negatíva • Padajúci simulátor • OS X • Keď sa niečo nedá napísať v

Negatíva • Padajúci simulátor • OS X • Keď sa niečo nedá napísať v XAML

www. dot. NETcollege. cz Kurzy Xamarin Forms Dot. Net. College Brno 28. 11. –

www. dot. NETcollege. cz Kurzy Xamarin Forms Dot. Net. College Brno 28. 11. – 30. 11. 12. – 14. 12. Roman Jašek MSP roman. jasek@riganti. cz