• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# NavigationPage类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: App

		public App ()
		{
			// The root page of your application
//			MainPage = new GridViewOptions ();
//			MainPage = new GridViewPerformance2 ();
			MainPage = new NavigationPage (new SampleMenu ());
		}
开发者ID:DevinvN,项目名称:TwinTechsFormsLib,代码行数:7,代码来源:TwinTechsFormsExample.cs


示例2: CreateMenuPage

		protected void CreateMenuPage(string menuPageTitle)
		{
			var _menuPage = new ContentPage ();
			_menuPage.Title = menuPageTitle;
			var listView = new ListView();

			listView.ItemsSource = new string[] { "Contacts", "Quotes", "Modal Demo" };

			listView.ItemSelected += async (sender, args) =>
			{

				switch ((string)args.SelectedItem) {
				case "Contacts":
					_tabbedNavigationPage.CurrentPage = _contactsPage;
					break;
				case "Quotes":
					_tabbedNavigationPage.CurrentPage = _quotesPage;
					break;
				case "Modal Demo":
                    var modalPage = FreshPageModelResolver.ResolvePageModel<ModalPageModel>();
					await PushPage(modalPage, null, true);
					break;
				default:
				break;
				}

				IsPresented = false;
			};

			_menuPage.Content = listView;

			Master = new NavigationPage(_menuPage) { Title = "Menu" };
		}
开发者ID:gaoxl,项目名称:FreshMvvm,代码行数:33,代码来源:CustomImplementedNav.cs


示例3: 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


示例4: App

 public App()
 {
     // The root page of your application
     MessagingCenter.Subscribe<Zombie>(this, "NavigateToZombie", NavigateToZombie);
     rootNavigationPage = new NavigationPage(new HomeView());
     MainPage = rootNavigationPage;
 }
开发者ID:tmyers5,项目名称:XamarinFormsWorkshop,代码行数:7,代码来源:App.cs


示例5: MainMenu

        public MainMenu()
        {

            var location = DependencyService.Get<IGetLocation>();

            var tabs = new TabbedPage();

            var mapLocation = new MapLocation();
            mapLocation.Title = "Accident Test";
            mapLocation.Icon = "splash";

            var mapNav = new NavigationPage(mapLocation);
            mapNav.Title = "Accident";
            mapNav.Icon = "splash.png";
            tabs.Children.Add(mapNav);

        

          

        

            /*     // demonstrates the Geocoder class
                 tabs.Children.Add(new CustomerDataGather { Title = "Geocode", Icon = "splash.png" });

                 // opens the platform's native Map app
                 tabs.Children.Add(new CustomerDataGather { Title = "Map App", Icon = "splash.png" });

     */
            MainPage = tabs;
        }
开发者ID:Railgun-it,项目名称:autoresolve-app,代码行数:31,代码来源:MainMenu.cs


示例6: App

        public App()
        {
            // Ensure link to Toolkit library.
            Color color = Xamarin.FormsBook.Toolkit.NamedColor.AliceBlue;

            MainPage = new NavigationPage(new ViewGalleryTypePage());
        }
开发者ID:jenart,项目名称:xamarin-forms-book-preview-2,代码行数:7,代码来源:App.cs


示例7: ConfigureApplication

        protected override void ConfigureApplication(IContainer container)
        {

            var viewFactory = container.Resolve<IViewFactory>();
            var txt = DependencyService.Get<IServicioFicheros>().RecuperarTexto(Cadenas.FicheroSettings);
            if (String.IsNullOrEmpty(txt))
            {
                var main = viewFactory.Resolve<LoginViewModel>(viewModel => {
                    viewModel.Titulo = "Login";
                });
                var np = new NavigationPage(main);
                _application.MainPage = np;
            }
            else
            {
                var data=JsonConvert.DeserializeObject<UsuarioModel>(txt);
                Session.User = data;
                var main = viewFactory.Resolve<LoginViewModel>(viewModel => {
                    viewModel.Titulo = "Login";
                });
                var np = new NavigationPage(main);
                _application.MainPage = np;
            }


            
            
        }
开发者ID:M1r3l,项目名称:RedSocialXamarin,代码行数:28,代码来源:StartUp.cs


示例8: App

 public App()
 {
     LoginView loginVew = new LoginView();
     loginVew.BindingContext = Container.Instance.Value.Get<LoginViewModel>();
     // The root page of your application
     MainPage = new NavigationPage(loginVew);
 }
开发者ID:juancuellor,项目名称:DotnetConference2016,代码行数:7,代码来源:App.cs


示例9: changeVisiblePage

		public void changeVisiblePage(ContentPage page)
		{
			NavigationPage navPage = new NavigationPage(page);
			navPage.BarBackgroundColor = Theme.getBackgroundColor ();
			navPage.BarTextColor = Theme.getTextColor();
			App.Current.MainPage = navPage;
		}
开发者ID:bsd5129,项目名称:LionHub,代码行数:7,代码来源:TabMenu.xaml.cs


示例10: App

        public App()
        {
            Translation.SetLocale ();

            var netLanguage = DependencyService.Get<ILocale>().GetCurrent();
            AppResources.Culture = new CultureInfo (netLanguage);

            Database = new MediandoDatabase ();
            //SyncData (Database);
            Device.OnPlatform(
                iOS: () => {
                    var homePage = new StartView ();
                    MainPage = homePage;
                },
                Android:() => {
                    var homePage = new NavigationPage (new StartView ()) {
                        BarBackgroundColor = Color.Black,
                        BarTextColor = Color.White,
                    };
                    MainPage = homePage;
                },
                WinPhone:()=>{
                    var homePage = new StartView ();
                    MainPage = homePage;
                }
            );

            App.AppSelected = ApplicationID.Default;
        }
开发者ID:CorningWebServices,项目名称:SolutionsKiosk,代码行数:29,代码来源:App.cs


示例11: App

 public App()
 {
     // Force a language change (for testing purposes)
     language.ChangeLanguage(textLanguage.Portuguese);
     // Set the main page of the application
     MainPage = new NavigationPage(new NavPage());
 }
开发者ID:yagoocarvalho,项目名称:NotifiqueMe,代码行数:7,代码来源:App.cs


示例12: RootPage

        /// <summary>
        /// Create the Root Page
        /// Define master and Detail as wenn as the default Detail page
        /// </summary>
        public RootPage()
        {
            var menuPage = new MenuPage ();
            // The effective navigation gets assigned
            menuPage.Menu.ItemSelected += (sender, e) => {
                // Before Navigating, recolor the cell
                if (menuPage.Menu.selected != null) {
                    menuPage.Menu.selected.SetColors (true);
                }

                // Select new
                menuPage.Menu.selected = (menuPage.Menu.SelectedItem as NavMenuItem);
                menuPage.Menu.selected.SetColors (false);

                NavigateTo (e.SelectedItem as NavMenuItem);
            };

            Master = menuPage;
            // Set default Detail page
            if (Device.OS == TargetPlatform.Android)
            {
                Detail = new NavigationPage(new pages.WelcomePage()) { BarBackgroundColor = Color.FromHex("FF4F45") };
            }
            else
            {
                Detail = new NavigationPage(new pages.WelcomePage());
            }
        }
开发者ID:auxua,项目名称:Qurvey,代码行数:32,代码来源:RootPage.cs


示例13: App

		public App ()
		{	
			MainPage = new NavigationPage(new RestaurantList (restaurants));

			MessagingCenter.Subscribe<RestaurantGuide.App, string> (this, "show", async (sender, arg) => {
				// do something whenever the "Hi" message is sent
				Debug.WriteLine("Search argument: " + arg);

				var restaurant = from r in restaurants
						where r.Name == arg
						select r;

				// set initial state
				await MainPage.Navigation.PopToRootAsync ();

				// load screen

				var rPage = new RestaurantDetail ();
				// set BindingContext
				rPage.BindingContext = restaurant.FirstOrDefault();

				// display screen
				await MainPage.Navigation.PushAsync (rPage);
			});
		}
开发者ID:ZaK14120,项目名称:xamarin-forms-samples,代码行数:25,代码来源:App.cs


示例14: App

        public App()
        {
            InitializeComponent();

            RootPage = new NavigationPage(new Views.Landing { BindingContext = new ViewModels.Landing() });
            MainPage = RootPage;
        }
开发者ID:rockfordlhotka,项目名称:MobileKidsIdApp,代码行数:7,代码来源:App.xaml.cs


示例15: App

 public App()
 {
     // The root page of your application
     var navPage = new NavigationPage(new MenuView());
     navPage.BarTextColor = Color.White;
     MainPage = navPage;
 }
开发者ID:jeffbmiller,项目名称:MosquitoTrapCount,代码行数:7,代码来源:MosquitoTrapCount.cs


示例16: CreatePageForNavigation

 public Page CreatePageForNavigation()
 {
     var newPage = new NavigationPage(_page);
     newPage.BarBackgroundColor = Color.Green;
     newPage.BarTextColor = Color.White;
     return newPage;
 }
开发者ID:zhouakun123,项目名称:prism,代码行数:7,代码来源:NavigationPageProvider.cs


示例17: App

        public App()
        {
            var app = Resolver.Resolve<IXFormsApp>();
            if (app == null)
            {
                return;
            }

            app.Closing += (o, e) => Debug.WriteLine("Application Closing");
            app.Error += (o, e) => Debug.WriteLine("Application Error");
            app.Initialize += (o, e) => Debug.WriteLine("Application Initialized");
            app.Resumed += (o, e) => Debug.WriteLine("Application Resumed");
            app.Rotation += (o, e) => Debug.WriteLine("Application Rotated");
            app.Startup += (o, e) => Debug.WriteLine("Application Startup");
            app.Suspended += (o, e) => Debug.WriteLine("Application Suspended");

            ViewFactory.Register<MainView, MainViewModel>();
            ViewFactory.Register<MapView, MapViewModel>();
            ViewFactory.Register<View.CameraView, CameraViewModel>();
            ViewFactory.Register<CodeScannerView, CodeScannerViewModel>();
            ViewFactory.Register<CommunicationView, CommunicationViewModel>();

            var mainPage = (Page)ViewFactory.CreatePage(typeof(MainViewModel));

            Resolver.Resolve<IDependencyContainer>()
                             .Register<INavigationService>(t => new NavigationService(mainPage.Navigation));
            MainPage = new NavigationPage(mainPage);


            // The root page of your application
           // MainPage =  new View.CameraView();
        }
开发者ID:TinusGreen,项目名称:GendacProjects,代码行数:32,代码来源:App.cs


示例18: Login

        private async void Login(object sender, LoginEventArgs e)
        {
            var dashboardPage = new DashboardPage(_userRepository);
            dashboardPage.GroupChoose += DashboardPageOnGroupChoose;

            MainPage = _navigationPage = new NavigationPage(dashboardPage);
        }
开发者ID:rwojcik,项目名称:imsClient,代码行数:7,代码来源:IMSClient.cs


示例19: App

        public App()
        {
            App.Self = this;

            var locator = CrossGeolocator.Current;
            locator.DesiredAccuracy = 50;

            var position = locator.GetPositionAsync(timeoutMilliseconds: 10000).ContinueWith((t) =>
           {
               if (t.IsCompleted)
               {
                   if (MyPosition == null)
                       MyPosition = new MyLatLong();
                   MyPosition.Latitude = t.Result.Latitude;
                   MyPosition.Longitude = t.Result.Longitude;
               }
           }).ConfigureAwait(true);

            PositionChanged += (object sender, PositionEventArgs e) =>
            {
                MyPosition.Latitude = e.Position.Latitude;
                MyPosition.Longitude = e.Position.Longitude;
                MessagingCenter.Send<App>(this, "LocChange");
            };

            PositionError += (object sender, PositionErrorEventArgs e) =>
            {
                MessagingCenter.Send<App, string>(this, "LocError", e.Error.ToString());
            };

            CrossGeolocator.Current.StartListeningAsync(1, 50, false);

            MainPage = new NavigationPage(new MappingPage());
        }
开发者ID:nodoid,项目名称:CustomMapping,代码行数:34,代码来源:CustomMapping.cs


示例20: NavigateTo

        void NavigateTo(MenuItem menu)
        {
            Page displayPage;
            var t = typeof(BucketListPage);
            if (menu.TargetType == t)
            {
                var category = menu.Category;
                if (category == null)
                {
                    displayPage = new BucketListPage();
                }
                else
                    displayPage = new BucketListPage(category);
            }
            else
            {
                displayPage = (Page)Activator.CreateInstance(menu.TargetType);
            }

            //            if (menu.TargetType is typeof(BucketListPage))
            //            {
            //                var category = menu.Category;
            //                Page = new BucketListPage
            //            };
            //            Page displayPage = (Page)Activator.CreateInstance (menu.TargetType);

            Detail = new NavigationPage (displayPage);

            IsPresented = false;
        }
开发者ID:nissan,项目名称:XFNavigation,代码行数:30,代码来源:MasterDetailRoot.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# NavigationParameters类代码示例发布时间:2022-05-24
下一篇:
C# NavigationMode类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap