public App() { TodoManager = new TodoItemManager (); MainPage = new NavigationPage (new TodoListPage ()); MessagingCenter.Subscribe <NSUserActivitySearch.App, string> (this, "ShowItem", async (sender, arg) => { var todoItems = TodoManager.All; var item = todoItems.FirstOrDefault (i => i.ID == arg); if (item != null) { await MainPage.Navigation.PopToRootAsync (); var todoItemPage = new TodoItemPage (); todoItemPage.BindingContext = item; await MainPage.Navigation.PushAsync (todoItemPage); } }); }
public App() { TodoManager = new TodoItemManager(); MainPage = new NavigationPage(new TodoListPage()); MessagingCenter.Subscribe <NSUserActivitySearch.App, string> (this, "ShowItem", async(sender, arg) => { var todoItems = TodoManager.All; var item = todoItems.FirstOrDefault(i => i.ID == arg); if (item != null) { await MainPage.Navigation.PopToRootAsync(); var todoItemPage = new TodoItemPage(); todoItemPage.BindingContext = item; await MainPage.Navigation.PushAsync(todoItemPage); } }); }