public async void PushPage(object sender, EventArgs eventArgs) { Debug.Assert( !Thread.CurrentThread.IsBackground, "Attempting to update UI on a background thread." ); var page = new SecondaryPage(); var viewModel = new SecondaryPageViewModel(); viewModel.Title = $"View No. {(++_counter).ToString()}"; viewModel.ShouldAdvance += PushPage; viewModel.ShouldPopToRoot += PopToRoot; page.BindingContext = viewModel; await _navigation.PushAsync(page); }
public SecondaryPage() { this.InitializeComponent(); this.VM = new SecondaryPageViewModel(); }