protected override void Init() { secondPage = new SecondPage(); var layout = new StackLayout(); var label = new Label { Text = "Click Next to push a modal, pop it, and push it again, you should see the second page a 2nd time without glitches.", VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, HorizontalTextAlignment = TextAlignment.Center }; var button = new Button { Text = "NextPage", Command = new Command(async() => { await Navigation.PushModalAsync(secondPage, false); }) }; layout.Children.Add(label); layout.Children.Add(button); BackgroundColor = Color.YellowGreen; Content = layout; }
void SecondFollowPrimary() { if (mainPage.DragPercent > 0) { SecondPage.BasePosition = mainPage.BasePosition - new Vector3(0, mainPage.BoxCollider.size.y, 0); SecondPage.PageIndex = _currentPageIndex + 1; } else if (mainPage.DragPercent < 0) { SecondPage.BasePosition = mainPage.BasePosition + new Vector3(0, mainPage.BoxCollider.size.y, 0); SecondPage.PageIndex = _currentPageIndex - 1; } else { SecondPage.BasePosition = mainPage.BasePosition - new Vector3(0, mainPage.BoxCollider.size.y, 0); SecondPage.PageIndex = -1; } if (_itemsList != null) { SecondPage.Refresh(SelectedItem, _itemsList); } if (SecondPage.PageIndex < 0 || SecondPage.PageIndex + 1 > PagesCount) { SecondPage.transform.localPosition = new Vector3(1000, 0, 0); } else { SecondPage.transform.localPosition = new Vector3(SecondPage.BasePosition.x, SecondPage.BasePosition.y + mainPage.DragDistance, SecondPage.BasePosition.z); } }
private void Button_Click(object sender, RoutedEventArgs e) { SecondPage sp = new SecondPage(); sp.raiseEventFromSecondPage += raiseEventFromSecondPage_EventHandler(); sp.Show(); }
public void GoogleWebPageTest() { IFirstPage testFirstPage = new FirstPage(webDriver); ISecondPage testSecondPage = new SecondPage(webDriver); testFirstPage.GoToGoogleSite(); testFirstPage.SearchText(); testSecondPage.CheckSearchResult(); }
protected override void OnElementChanged(ElementChangedEventArgs <Page> e) { base.OnElementChanged(e); SecondPage page = e.NewElement as SecondPage; var activity = this.Context as Activity; page.Paramters = new PlatformParameters(activity); }
private SharpProp CreateTree() { var firstPage = new FirstPage { Number = state.FirstPage.Number }; var secondPage = new SecondPage { Text = state.SecondPage.Text }; return(new Router { Children = { new HomeRoute { Content = firstPage }, new TypeRoute <FirstPageNavigationArgs> { Content = firstPage }, new TypeRoute <SecondPageNavigationArgs> { Content = secondPage } } }); //return new FirstPage(); //return new StackPanel //{ // Key = "master", // Children = // { // //new Sharp.TextBlock { Key=0, Text = "Test1" }, // //new Sharp.TextBlock { Key=1, Text = "Test2" }, // //new Sharp.TextBlock { Key=2, Text = "Test3" }, // new Button { // Click = Clicked, // FontSize = 30, // Content = new TextBlock { Text = buttonText } // }, // new Button { // Click = Clicked, // FontSize = 30, // Content = new TextBlock { Text = "xxx" } // }, // } //}; //return new Button //{ // Click = Clicked, // FontSize = 30, // Content = new TextBlock { Text = buttonText } //}; }
public MainPage() { InitializeComponent(); List <PayementOption> PayementOptions = new List <PayementOption>() { new PayementOption { ImageSource1 = "credit_card.png", Name = "Credit Card", Price = 0 }, new PayementOption { ImageSource1 = "bank_transfer.png", Name = "Bank Transfer", Price = 0 }, }; List <DeliveryOption> DeliveryOptions = new List <DeliveryOption>() { new DeliveryOption { ImageSource1 = "normal_shipping.png", Name = "Express", Price = 30 }, new DeliveryOption { ImageSource1 = "express_shipping.png", Name = "Normal", Price = 10 }, }; this.PayementStep = 0; //Step3Image.Source = this.acimgsource; //Step2Image.Source = this.acimgsource; //Step3Image.Source = this.acimgsource; Step1Frame.HasShadow = true; //Step1Frame.OutlineColor = Color.FromHex("#443E43"); //Step1Frame.BackgroundColor = Color.FromHex("#F9FAFC"); Step2Frame.HasShadow = true; //Step2Frame.OutlineColor = Color.FromHex("#443E43"); //Step2Frame.BackgroundColor = Color.FromHex("#F9FAFC"); Step3Frame.HasShadow = true; //Step3Frame.OutlineColor = Color.FromHex("#443E43"); //Step3Frame.BackgroundColor = Color.FromHex("#F9FAFC"); switchsteps(this.PayementStep); this.a = new FirstPage(this); this.aa = new SecondPage(a); this.aaa = new ThirdPage(aa); CheckOutContentHolder.Content = a.Content; }
public Measurement(SecondPage SecondPageAsParam) { razchce=true; CommandsToJointsIndex=0; Index=15; CheckingChecking=0; joint_names=Enum.GetNames(typeof(JointType)); cangetthru=false; command=String.Empty; PositioningBool=new Dictionary<string, Tuple<Dictionary<string, bool>, bool>>(); once_gone=true; once_gone_thru_for_COG=false; WhatToDo="Wyprowadzenie_ciosu"; ShowMovementOnTeacher_BOOL_ONCE=true; SetStartingPosition_BOOL_ONCE=true; wait_bool=false; SecondPageObj=SecondPageAsParam; }
void ExchangePrimary(DragDirection direction) { FCUIInventorySlotPage temp = mainPage; mainPage = SecondPage; SecondPage = temp; mainPage.IsPrimary = true; SecondPage.IsPrimary = false; mainPage.BasePosition = _mainBasePosition; SecondPage.ChangeBasePositionByDirection(direction); if (direction == DragDirection.Upper) { _currentPageIndex++; } else if (direction == DragDirection.Lower) { _currentPageIndex--; } mainPage.PageIndex = _currentPageIndex; prograssBar.SepPagePercent(_currentPageIndex, PagesCount); }
//---------------------------------- //NOTE: On Windows you must copy SharedLib manually (https://github.com/ForeverZer0/glfw-net#microsoft-windows) //---------------------------------- static void Main(string[] args) { //Creating a window var op = new SharpWindowOptions(); op.title = "Hello"; op.windowBackgroundColor = SKColors.LightSkyBlue; op.runOptions = WindowRunOptions.WaitEvents; var sWindow = new SharpWindow(op); var context = sWindow.contextUI; //Creating a page var page = new MainPage(context); var page2 = new SecondPage(context); context.GotoPage("main"); sWindow.Run(); sWindow.Dispose(); }
/// <summary> /// Implementation of navigation. This is specific to Xamarin.Forms /// </summary> /// <param name="sender">Caller</param> /// <param name="newModel">Type of the target view model</param> public void NavigateTo(object sender, Type newModel) { // if the target is SecondPageViewModel // create that page, bonding and navigate to it if (newModel == typeof(SecondPageViewModel)) { var callerVM = ((MvvmAtomSampleMainViewModel)((AtomCommandBase)sender).ViewModel); var vm = new SecondPageViewModel(); vm.UserName = callerVM.UserName; var page = new SecondPage() { BindingContext = vm }; App.Current.MainPage.Navigation.PushAsync(page); } else // Just show a message box { var callerVM = ((SecondPageViewModel)((AtomCommandBase)sender).ViewModel); App.Current.MainPage.DisplayAlert("Demo message box", $"Thanks for watching this Demo - {callerVM.UserName}!", "OK"); } }
public void NavigateToSecondPage(Object parameters) { if (!this.Frame.CanGoBack) { SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible; SystemNavigationManager.GetForCurrentView().BackRequested += GoBack_event; } this.onNavigated = (e) => { var vm = (VMSecond)(e.Content as SecondPage).DataContext; var film = (VMItemFilm)parameters; SecondPage sp = (e.Content as SecondPage); if (sp != null) { sp.InitializeNotificaciones(vm); vm.LoadCompleteFilm(film); } }; this.Frame.Navigated += RootFrame_Navigated; this.Frame.Navigate(typeof(SecondPage)); }
private void OnGotoNextPageButtonClicked() { var nextPage = new SecondPage(); Xamarin.Forms.Application.Current.MainPage.Navigation.PushAsync(nextPage); }
private void button_Click(object sender, RoutedEventArgs e) { _SecondPage = _SecondPage != null ? new SecondPage(); main.Content = _SecondPage; }
protected override void OnElementChanged(VisualElementChangedEventArgs e) { base.OnElementChanged(e); page = e.NewElement as SecondPage; }
public void SetSecondPageInMeasurement(SecondPage secondpage_as_param) { SecondPageObj=secondpage_as_param; }