コード例 #1
0
ファイル: Page.cs プロジェクト: freeman888/GI
                public override object Run(Hashtable xc)
                {
                    GasControl.Page.Page page = xc.GetCSVariableFromSpeType <GasControl.Page.Page>("page", "Page");
                    if ((App.MainApp.MainPage as NavigationPage).CurrentPage.GetType() != typeof(ConsolePage))
                    {
                        throw new Exceptions.RunException(Exceptions.EXID.逻辑错误, "请勿多次调用本方法");
                    }

                    Task.Run(() =>
                    {
                        Device.BeginInvokeOnMainThread(async() =>
                        {
                            if (Device.RuntimePlatform == Device.macOS)
                            {
                                await App.MainApp.MainPage.Navigation.PushAsync(page);
                                App.MainApp.MainPage.Navigation.RemovePage(App.MainApp.MainPage.Navigation.NavigationStack[0]);
                            }
                            else
                            {
                                App.MainApp.MainPage = new NavigationPage(page);
                            }
                        });
                    });

                    return(new Variable(0));
                }
コード例 #2
0
ファイル: Page.cs プロジェクト: freeman888/GI
 public PageClassTemplate() : base("Page", "Page")
 {
     Istr_xcname = "title";
     csctor      = (xc) =>
     {
         string title = Variable.GetTrueVariable <object>(xc, "title").ToString();
         GasControl.Page.Page gasPage = new GasControl.Page.Page(title);
         gasPage.BackgroundColor = Xamarin.Forms.Color.White;
         return(gasPage);
     };
 }
コード例 #3
0
ファイル: Page.cs プロジェクト: freeman888/GI
                public override object Run(Hashtable xc)
                {
                    GasControl.Page.Page page = xc.GetCSVariableFromSpeType <GasControl.Page.Page>("page", "Page");
                    System.Diagnostics.Debug.WriteLine(page.Title);

                    Task.Run(() =>
                    {
                        Device.BeginInvokeOnMainThread(async() =>
                        {
                            await Task.Delay(20);
                            //await (App.MainApp.MainPage as NavigationPage).CurrentPage.Navigation.PushAsync(page);
                            await(App.MainApp.MainPage as NavigationPage).Navigation.PushAsync(page);
                        });
                    });
                    return(new Variable(0));
                }