private async void SelectedCategoryAction(object param) { if (param == null) { return; } var cate = param as CAKE_TYPE; var clonedCate = cate.ShallowClone(); this._categoryDialogViewModel = new CategoryDialogViewModel() { SelectedCakeType = clonedCate, Status = "Edit cake type" }; var view = new CategoryDialogControl { DataContext = this._categoryDialogViewModel }; //show the dialog var result = await DialogHost.Show(view, MainWindowViewModel.Instance.Identifier, ExtendedOpenedEventHandler, EditCateDialogClosingEventHandler); //check the result... Console.WriteLine("Dialog was closed, the CommandParameter used to close it was: " + (result ?? "NULL")); }
private async void ExecuteAddCateDialog(object obj) { this._categoryDialogViewModel = new CategoryDialogViewModel() { SelectedCakeType = new CAKE_TYPE(), Status = "Add cake type" }; var view = new CategoryDialogControl { DataContext = this._categoryDialogViewModel }; //show the dialog var result = await DialogHost.Show(view, MainWindowViewModel.Instance.Identifier, ExtendedOpenedEventHandler, AddCateDialogClosingEventHandler); //check the result... Console.WriteLine("Dialog was closed, the CommandParameter used to close it was: " + (result ?? "NULL")); }