private void Button_Clicked(object sender, EventArgs e) { var navigationData = new ZCMobileNavigationData { CurrentPage = this, CurrentPageTitle = App.MasterDetailVM.Header1, NextPage = new Page6(), NextPageTitle = App.PageTitels["page6"] }; App.MasterDetailVM.PushAsync(navigationData); }
/// <summary> /// This is the method to push pages for navigation. /// It manages the navigation stack to push pages as per orientation and size of stack. /// </summary> /// <param name="navigationData"></param> public void PushAsync(ZCMobileNavigationData navigationData) { if (Isportrait || pages.Count == 0) // This is for potrait mode { Header = navigationData.NextPageTitle; PushAsync(navigationData.NextPage); } else//This is for landscape mode { Header = navigationData.CurrentPageTitle; Header1 = navigationData.NextPageTitle; PushAsync(navigationData.CurrentPage); PushAsync1(navigationData.NextPage); } }
private async void Button_Clicked(object sender, EventArgs e) { App.MasterDetailVM.IsExecuting = true; await Task.Delay(1800); var navigationData = new ZCMobileNavigationData { CurrentPage = this, CurrentPageTitle = App.MasterDetailVM.Header1, NextPage = new Page3(), NextPageTitle = App.PageTitels["page3"] }; App.MasterDetailVM.PushAsync(navigationData); App.MasterDetailVM.IsExecuting = false; }
private async void Button_Clicked(object sender, EventArgs e) { App.MasterDetailVM.IsExecuting = true; await Task.Delay(1800); var bindingContext = this.BindingContext as Page1ViewModel; App.ApplicationDataViewModel = new Page2ViewModel { Messsge1 = bindingContext.Messsge1, Messsge2 = bindingContext.Messsge2 }; var navigationData = new ZCMobileNavigationData { CurrentPage = this, CurrentPageTitle = App.MasterDetailVM.Header, NextPage = new Page2(), NextPageTitle = App.PageTitels["page2"] }; App.MasterDetailVM.PushAsync(navigationData); App.MasterDetailVM.IsExecuting = false; }
/// <summary> /// Prepared a Sample Object for Accrodion control /// </summary> /// <returns></returns> private List <AccordionSource> GetSampleData() { var vResult = new List <AccordionSource>(); var accordianObject = PreparedObject(); foreach (var item in accordianObject) { Grid gd = new Grid(); // gd.BackgroundColor = Color.FromHex("#01446b"); if (item.ChildItemList.Count > 0) { foreach (var child in item.ChildItemList) { gd.RowDefinitions.Add(new RowDefinition { Height = 25 }); gd.RowSpacing = 1; gd.ColumnSpacing = 1; gd.Margin = new Thickness(2, 0, 0, 0); } if (item.ChildItemList.Any(q => q.BubbleCount > 0)) { gd.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }); Device.OnPlatform(iOS: () => { gd.ColumnDefinitions.Add(new ColumnDefinition { Width = 25 }); }, Android: () => { gd.ColumnDefinitions.Add(new ColumnDefinition { Width = 30 }); }); } int rowCount = 0; foreach (var actual in item.ChildItemList) { Label lbl = new Label(); lbl.Text = actual.TextValue; //lbl.HeightRequest = 30; lbl.StyleId = actual.DataValue; lbl.Margin = new Thickness(2, 0, 0, 0); lbl.TextColor = Color.FromHex("#c1eaf6"); TapGestureRecognizer tg = new TapGestureRecognizer(); tg.Tapped += (ea, sa) => { var label = ea as Label; if (label.Text != "Logout" && label.Text != "Information") { RemoveAllPages(); //Header = "Page 1"; //RightButton = "..."; //var page = new Page1(); var navigationData = new ZCMobileNavigationData { CurrentPage = null, CurrentPageTitle = string.Empty, NextPage = new Page1(), NextPageTitle = App.PageTitels["page1"] }; PushAsync(navigationData); if (App.MasterDetailVM.Isportrait) { App.UserSession.SideContentVisibility = (!App.UserSession.SideContentVisibility); RaisePropertyChanged("SideContentVisible"); } } else if (label.Text == "Information") { //de var navigationData = new ZCMobileNavigationData { CurrentPage = null, CurrentPageTitle = string.Empty, NextPage = new Dossier(), NextPageTitle = App.PageTitels["dossier"] }; PushAsync(navigationData); if (App.MasterDetailVM.Isportrait) { App.UserSession.SideContentVisibility = (!App.UserSession.SideContentVisibility); RaisePropertyChanged("SideContentVisible"); } } else { RemoveAllPages(); App.MasterDetailVM.Header = "Login Page"; App.MasterDetailVM.HamburgerVisibility = false; App.IsUSerLoggedIn = false; App.UserSession.SideContentVisibility = false; App.MasterDetailVM.PopAsyncInitialPages(true); RemoveAllInitialPages(); } }; lbl.GestureRecognizers.Add(tg); Grid.SetRow(lbl, rowCount); if (actual.BubbleCount > 0) { BoxView bx = new BoxView(); bx.HeightRequest = 5; bx.WidthRequest = 5; bx.BackgroundColor = Color.White; Grid.SetColumn(bx, 1); Grid.SetRow(bx, rowCount); gd.Children.Add(bx); Label bubblecount = new Label(); //bubblecount.HeightRequest = 10; //bubblecount.WidthRequest = 10; bubblecount.Text = actual.BubbleCount.ToString(); bubblecount.VerticalTextAlignment = TextAlignment.Center; bubblecount.HorizontalOptions = LayoutOptions.Center; bubblecount.VerticalOptions = LayoutOptions.Center; Grid.SetColumn(bubblecount, 1); Grid.SetRow(bubblecount, rowCount); gd.Children.Add(bubblecount); } gd.Children.Add(lbl); rowCount++; } vResult.Add(new AccordionSource { HeaderText = item.HeaderText, HeaderTextColor = Color.FromHex("#c1eaf6"), HeaderBackGroundColor = Color.FromHex("#3c9ece"), ContentItems = gd }); } else { vResult.Add(new AccordionSource { HeaderText = item.HeaderText, HeaderTextColor = Color.FromHex("#c1eaf6"), HeaderBackGroundColor = Color.FromHex("#3c9ece"), ContentItems = gd, }); } } return(vResult); }