Skip to content

Instantly share code, notes, and snippets.

@Yelnik
Created June 1, 2017 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Yelnik/e01f5dff6bab89a3a29a28dd22fc2f36 to your computer and use it in GitHub Desktop.
Save Yelnik/e01f5dff6bab89a3a29a28dd22fc2f36 to your computer and use it in GitHub Desktop.
public App() {
SetMainPage();
}
public static async void SetMainPage() {
Current.MainPage = new TabbedPage {
Children =
{
new NavigationPage(new StatsPage(GetLatestSessions()))
{
Title = "Stats",
Icon = Device.OnPlatform("tab_stats.png",null,null)
},
new NavigationPage(new SetupPage()
{
Title = "Setup",
Icon = Device.OnPlatform("tab_setup.png",null,null)
},
new NavigationPage(new SettingsPage())
{
Title = "Settings",
Icon = Device.OnPlatform("tab_settings.png",null,null)
}
}
};
var curPage = Current.MainPage as TabbedPage;
curPage.CurrentPage = curPage.Children[1];
}
. . . .
//Open modal from center page here
private async void someButton_Click(object sender, EventArgs e) {
...
pp = new TrainPage(Convert.ToInt32(revLabel.Text), Convert.ToInt32(cwLabel.Text), Convert.ToInt32(ccwLabel.Text));
await Navigation.PushModalAsync(pp);
}
....
protected override void OnAppearing() {
System.Diagnostics.Debug.WriteLine("StatsPage OnAppearing entered. . .");
base.OnAppearing();
}
private void SomeButton(object o, EventArgs e) {
StatsDayPage sp = new StatsDayPage(App.GetSessionsByNumber(App.CurrentSessionNumber - 1), true);
Navigation.PushModalAsync(sp);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment