Telerik School Academy Xamarin 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