当前位置: 首页>>代码示例>>C#>>正文


C# NavigationPage.PushAsync方法代码示例

本文整理汇总了C#中NavigationPage.PushAsync方法的典型用法代码示例。如果您正苦于以下问题:C# NavigationPage.PushAsync方法的具体用法?C# NavigationPage.PushAsync怎么用?C# NavigationPage.PushAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NavigationPage的用法示例。


在下文中一共展示了NavigationPage.PushAsync方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: App

		public App ()
		{
			var nav = new NavigationPage ();
			nav.BarBackgroundColor = Color.Transparent;
			nav.BarTextColor = Color.White;


			var listpage = new ContentPage ();
			listpage.Content = new ListView { ItemsSource = new List<ContentPage> {
					new StackLayoutPageXaml(),
					new StackLayoutPageCode(),
					new RelativeLayoutPageXaml(),
					new RelativeLayoutPageCode(),
					new GridPageXaml(),
					new GridPageCode(),
					new AbsoluteLayoutPageXaml(),
					new AbsoluteLayoutPageCode()
				}, ItemTemplate = new DataTemplate(typeof(CustomCell))
			};
			((ListView)listpage.Content).ItemSelected += (object sender, SelectedItemChangedEventArgs e) => {
				nav.PushAsync((ContentPage)e.SelectedItem);
			};
			nav.PushAsync (listpage);

			// The root page of your application
			MainPage = nav;
		}
开发者ID:RickySan65,项目名称:xamarin-forms-samples,代码行数:27,代码来源:ResponsiveLayout.cs

示例2: App

		public App ()
		{
			NavigationPage nav = new NavigationPage ();
			// The root page of your application
			MainPage = nav;
			nav.PushAsync (new HomeCode ());
		}
开发者ID:RickySan65,项目名称:xamarin-forms-samples,代码行数:7,代码来源:twoWayBinding.cs

示例3: App

        public App()
        {
            // Setup page navigation
            var navigationPage = new NavigationPage();
            navigationPage.PushAsync(new FirstPage(), false);

            MainPage = navigationPage;
        }
开发者ID:robhogfeldt,项目名称:xam-forms-transparent-modal,代码行数:8,代码来源:App.cs

示例4: App

        public App()
        {
            var loginPage = new LoginPage();
            loginPage.Login += Login;
            loginPage.Register += Register;
            MainPage = _navigationPage = new NavigationPage();

            _navigationPage.PushAsync(loginPage);
        }
开发者ID:rwojcik,项目名称:hciPrototype,代码行数:9,代码来源:App.cs

示例5: MainPage

 public MainPage()
 {
     var welcomePage = new ContentPage {Title = "Welcome"};
     var navigationPage = new NavigationPage {Title = "Detail"};
     navigationPage.PushAsync(welcomePage);
     var master = new MenuPage(navigationPage) {Title = "Menu"};
     Master = master;
     Detail = navigationPage;
 }
开发者ID:farp,项目名称:xfplayground,代码行数:9,代码来源:MainPage.cs

示例6: App

        public App()
        {
			var tabs = new TabbedPage ();
			var navPage = new NavigationPage () {Title="App Content"};
			tabs.Children.Add (navPage);

			bool useXaml = false; //change this to use the code implementation

			if (useXaml) {
				
				navPage.PushAsync (new LinkToInAppXaml ());
				tabs.Children.Add (new LoadingLabelXaml ());
			} else {
				navPage.PushAsync (new LinkToInAppCode ());
				tabs.Children.Add (new LoadingLabelCode ());
			}

			MainPage = tabs;
        }
开发者ID:ChandrakanthBCK,项目名称:xamarin-forms-samples,代码行数:19,代码来源:App.cs

示例7: NavBarTitleTestPage

		public NavBarTitleTestPage ()
		{
			var navTab = new NavigationPage { Title = "Hello 1 nav"};
			navTab.PushAsync (GetPage (navTab));

			var stackPages = new StackLayout ();

			var btn3 = new Button {
				Text = "tab", Command = new Command (async () => {
					var tabbed = new TabbedPage { Title = "Main Tab" };
					tabbed.Children.Add (navTab);
					tabbed.Children.Add (GetPage (navTab));
					await Navigation.PushModalAsync (tabbed);
				})
			};

			var btn4 = new Button {
				Text = "mdp", Command = new Command (async () => {
					var newNav = new NavigationPage { Title = "Hello 1 nav", BarBackgroundColor = Color.Pink, BarTextColor = Color.Blue };
					var mdp = new MasterDetailPage ();
					await newNav.PushAsync (GetPage (newNav));
					mdp.Master = new ContentPage {
						Title = "Master", BackgroundColor = Color.Red, Content = new Button {
							Text = "new", Command = new Command (() => {
								mdp.Detail = new ContactsPage { Title = "hello 3" };
								mdp.IsPresented = false;
							})
						}
					};
					mdp.Detail = newNav;
					await Navigation.PushModalAsync (mdp);
				})
			};

			var btn5 = new Button {
				Text = "nav", Command = new Command (async () => {
					var newNav = new NavigationPage { Title = "Hello 1 nav" };
					await newNav.PushAsync (GetPage (newNav));
					await Navigation.PushModalAsync (newNav);
				})
			};

			var btn6 = new Button {
				Text = "change nav", Command = new Command (() => {
					(Parent as NavigationPage).BarBackgroundColor = Color.Blue;
					(Parent as NavigationPage).BarTextColor = Color.Pink;
				})
			};

			stackPages.Children.Add (btn3);
			stackPages.Children.Add (btn4);
			stackPages.Children.Add (btn5);
			stackPages.Children.Add (btn6);
			Content = stackPages;
		}
开发者ID:Costo,项目名称:Xamarin.Forms,代码行数:55,代码来源:NavBarTitleTestPage.cs

示例8: createTodoPage

        private Page createTodoPage()
        {
            var button = new Button { Text = "button1" };
            var page = new TODO();

            NavigationPage.SetHasNavigationBar(page, true);
            var navPage = new NavigationPage(page) { Title = "TODOs" };

            button.Clicked += (s, e) => navPage.PushAsync(new TODO());
            return navPage;
        }
开发者ID:djoker07,项目名称:c_sharp,代码行数:11,代码来源:App.cs

示例9: StateMachineData

		StateMachineData _stateMachineData = new StateMachineData ();			// shared data struct, used by all pages to pass data


		public StateMachine (Node startNode)
		{
			// create a new navpage to push the state machine onto, and which then can be popped off at the end
			_navigationPage = new NavigationPage();								

			// create the first page of the sequence
			StateMachinePage p = PageFactory.CreatePage (startNode.pageType, _navigationPage, _stateMachineData, HandleSequenceEnd, HandleCancel );
			startNode.CreatePages (p, _navigationPage, _stateMachineData, HandleSequenceEnd, HandleCancel);

			// start the sequence going ...
			_navigationPage.PushAsync (p);
		}
开发者ID:populvuh,项目名称:StateMachine,代码行数:15,代码来源:StateMachine.cs

示例10: pressCycleThemeButton

    public void pressCycleThemeButton(object sender, EventArgs args) {
      Theme.cycleTheme();

      SQLiteConnection con = DependencyService.Get<IDatabaseHandler>().getDBConnection();
      var theme = con.Table<Info>().Where(i => i.key.Equals("theme")).FirstOrDefault();
      theme.value = Theme.getActiveThemeId();
      con.Update(theme);
      con.Close();

      NavigationPage page = new NavigationPage(new Home_Screen());
      page.PushAsync(new Settings_Screen());
      ((Orientation.App)App.Current).setMainPage(page);
    }
开发者ID:bsd5129,项目名称:LionHub,代码行数:13,代码来源:Settings_Screen.xaml.cs

示例11: TestPushRoot

		public async Task TestPushRoot ()
		{
			NavigationPage nav = new NavigationPage ();

			Assert.IsNull (nav.CurrentPage);

			Label child = new Label {Text = "Label"};
			Page childRoot = new ContentPage {Content = child};

			await nav.PushAsync (childRoot);

			Assert.AreSame (childRoot, nav.CurrentPage);
		}
开发者ID:Costo,项目名称:Xamarin.Forms,代码行数:13,代码来源:NavigationUnitTest.cs

示例12: App

		public App (Configuration configuration)
		{
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");    
            }
            _configuration = configuration;

            var navigationPage = new NavigationPage();
            navigationPage.PushAsync(new AuthenticationPage(navigationPage, _configuration));

            MainPage = navigationPage;
		}
开发者ID:PureKrome,项目名称:XamarinForms.StarterKit,代码行数:13,代码来源:App.cs

示例13: TestPushEvent

		public async Task TestPushEvent ()
		{
			NavigationPage nav = new NavigationPage ();
			
			Label child = new Label ();
			Page childRoot = new ContentPage {Content = child};

			bool fired = false;
			nav.Pushed += (sender, e) => fired = true;

			await nav.PushAsync (childRoot);
			
			Assert.True (fired);
		}
开发者ID:Costo,项目名称:Xamarin.Forms,代码行数:14,代码来源:NavigationUnitTest.cs

示例14: App

		public App ()
		{
			var mainPage = new CodedPage ();
			var navigationPage = new NavigationPage (mainPage);
			mainPage.ItemSelected += async (sender, e) => {
				var detailPage = new DetailPage {
					BindingContext = e,
				};
				await navigationPage.PushAsync (detailPage);
			};

			// The root page of your application
			MainPage = navigationPage;
			MainPage.BindingContext = ViewModel;
		}
开发者ID:patridge,项目名称:demos-xamarin.forms-tour,代码行数:15,代码来源:X.FUIdemo.cs

示例15: App

        public App(IUserRepository userRepository = null, IServerFinder serverFinder = null)
        {
            _serverFinder = serverFinder;
            _userRepository = userRepository ?? DependencyService.Get<IUserRepository>();

            MainPage = _navigationPage = new NavigationPage();

            if (_userRepository.IsLogged())
            {
                _dashboardPage = new DashboardPage(_userRepository);

                _navigationPage.PushAsync(_dashboardPage);
            }
            else
            {
                var loginPage = new LoginPage(_userRepository);

                loginPage.Login += Login;
                loginPage.Register += Register;

                _navigationPage.PushAsync(loginPage);
            }

        }
开发者ID:rwojcik,项目名称:imsClient,代码行数:24,代码来源:IMSClient.cs


注:本文中的NavigationPage.PushAsync方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。