public IdeaViewModel(INavigation navigation, Idea idea) : base(navigation) { Idea = idea; SaveCommand = new Command(async () => { var service = await App.GetIdeaServiceAsync(); await service.SaveIdeaAsync(Idea); await Navigation.PopAsync(); }); DeleteCommand = new Command(async () => { var service = await App.GetIdeaServiceAsync(); await service.DeleteIdeaAsync(Idea); await Navigation.PopAsync(); }); CancelCommand = new Command(() => { Navigation.PopAsync(); }); }
public IdeaView(Idea idea) { InitializeComponent(); BindingContext = new IdeaViewModel(Navigation, idea); }