本文整理汇总了C#中NavigationPage类的典型用法代码示例。如果您正苦于以下问题:C# NavigationPage类的具体用法?C# NavigationPage怎么用?C# NavigationPage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NavigationPage类属于命名空间,在下文中一共展示了NavigationPage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: App
public App ()
{
// The root page of your application
// MainPage = new GridViewOptions ();
// MainPage = new GridViewPerformance2 ();
MainPage = new NavigationPage (new SampleMenu ());
}
示例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" };
}
示例3: App
public App ()
{
NavigationPage nav = new NavigationPage ();
// The root page of your application
MainPage = nav;
nav.PushAsync (new HomeCode ());
}
示例4: App
public App()
{
// The root page of your application
MessagingCenter.Subscribe<Zombie>(this, "NavigateToZombie", NavigateToZombie);
rootNavigationPage = new NavigationPage(new HomeView());
MainPage = rootNavigationPage;
}
示例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;
}
示例6: App
public App()
{
// Ensure link to Toolkit library.
Color color = Xamarin.FormsBook.Toolkit.NamedColor.AliceBlue;
MainPage = new NavigationPage(new ViewGalleryTypePage());
}
示例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;
}
}
示例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);
}
示例9: changeVisiblePage
public void changeVisiblePage(ContentPage page)
{
NavigationPage navPage = new NavigationPage(page);
navPage.BarBackgroundColor = Theme.getBackgroundColor ();
navPage.BarTextColor = Theme.getTextColor();
App.Current.MainPage = navPage;
}
示例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;
}
示例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());
}
示例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());
}
}
示例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);
});
}
示例14: App
public App()
{
InitializeComponent();
RootPage = new NavigationPage(new Views.Landing { BindingContext = new ViewModels.Landing() });
MainPage = RootPage;
}
示例15: App
public App()
{
// The root page of your application
var navPage = new NavigationPage(new MenuView());
navPage.BarTextColor = Color.White;
MainPage = navPage;
}