telerik school academy xamarin apps for ios, android & winphone

Click here to load reader

Upload: -

Post on 17-Jan-2018

237 views

Category:

Documents


0 download

DESCRIPTION

 Represents cross-platform mobile app screens  Contains a single child  A Xamarin.Forms.Page represents:  Activity in Android  View Controller in iOS  Page in Windows Phone 3

TRANSCRIPT

Telerik School AcademyXamarin apps for iOS, Android & WinPhone 1. What is a Page in Xamarin? 2. Page Types ContentPage MasterDetailPage CarouselPage TabbedPge NavigationPage 3. Navigation 2 Represents cross-platform mobile app screens Contains a single child A Xamarin.Forms.Page represents: Activity in Android View Controller in iOS Page in Windows Phone 3 Android AndroidActivity iOS UIApplicationDelegate Windows Phone PhoneApplicationPage Xamarin.Forms.Forms.Init(this, bundle); SetPage(App.GetMainPage()); 4 Xamarin.Forms.Forms.Init(); window = new UIWindow(UIScreen.MainScreen.Bounds); window.RootViewController = App.GetMainPage().CreateViewController();window.MakeKeyAndVisible(); Xamarin.Forms.Forms.Init(); Content = HelloXamarinFormsWorld.App.GetMainPage().ConvertPageToUIElement(this); 5 Displays a single View new ContentPage { Content = new Label { Text = "Hello, Forms!", VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, },}; 6 7 Manages two panes of information Master use to display a list of items Detail bind with selected item from Master IsPresented show Master or not new MasterDetailPage = { Master = new ContentPage() {... }, Detail = new ContentPage() {... }, }; 8 9 Allows swipe gesture navigation like gallery Natural and familiar to Windows Phone Acts like a ListView with ItemsSource var page = new CarouselPage(); page.Children.Add(new ContentPage()); page.ItemsSource = new ContentPage[]; 10 11 Allows navigation between pages, using tabs List of items across the top and a detail area below var page = new CarouselPage(); page.ItemsSource = new ContentPage[]; Page.ItemTemplate = new DataTemplate(() =>{ return new Contentpage() {... }; }); 12 13 Manages the navigations of a stack of other pages PushAsync add a Page to the stack PopAsync remove the top Page from the stack PopToRootAsync remove all except root page var page = new NavigationPage(new ContentPage()); 14 15 Handled by the INavigation interface public class App { public static INavigation Navigation { get; set; } public static Page GetMainPage() { var homePage = new HomePage(); Navigation = homePage.Navigation; return new NavigationPage(homePage); }} 16 private async void ButtonNavigate_Clicked( object sender, EventArgs e) { await App.Navigation.PushAsync(new SecondPage()); } 1. What is a Page in Xamarin? 2. Page Types ContentPage MasterDetailPage CarouselPage TabbedPge NavigationPage 3. Navigation 17 , , SEO - , HTML, CSS, JavaScript, Photoshop ASP.NET MVC HTML, SQL, C#,.NET, ASP.NET MVC " cloud " BG Coder - - online judge , " " , ASP.NET - , , C#,.NET, ASP.NET iPhone, Android, WP7, PhoneGap free C# book, C#, Java, C# - C# Telerik Academy csharpfundamentals.telerik.com csharpfundamentals.telerik.com Telerik Software Academy academy.telerik.com academy.telerik.com Telerik Facebook facebook.com/TelerikAcademy facebook.com/TelerikAcademy Telerik Software Academy Forums forums.academy.telerik.com forums.academy.telerik.com