private void DialogRemoveCollection_DialogCompleted(object sender, DialogButtonClickedEventArgs e) { if (e.DialogResult == DialogResult.OK) { TileManagerViewModel vm = DataContext as TileManagerViewModel; CollectionSet selectedCollection = vm.SelectedCollection; selectedCollection.Delete(); vm.LoadedCollections.Remove(selectedCollection); vm.SelectedCollection = null; } }
private void DialogRemovePlaceable_DialogCompleted(object sender, DialogButtonClickedEventArgs e) { if (e.DialogResult == DialogResult.OK) { TileManagerViewModel vm = DataContext as TileManagerViewModel; Placeable selectedPlaceable = vm.SelectedCollection.PlaceableFile.Data[vm.SelectedPlaceableIndex]; int index = vm.SelectedCollection.PlaceableFile.Data.ToList().FindIndex(x => x.Guid == selectedPlaceable.Guid); if (index > -1) { vm.SelectedCollection.PlaceableFile.Data.RemoveAt(index); vm.SelectedPlaceableIndex = -1; } } }
private void DialogButtonClicked(object sender, DialogButtonClickedEventArgs e) { if (e.Button == DialogButton.FirstButton) { e.CloseDialogAfterHandle = CloseOnFirstButton; } else if (e.Button == DialogButton.SecondButton) { e.CloseDialogAfterHandle = CloseOnSecondButton; } else if (e.Button == DialogButton.ThirdButton) { e.CloseDialogAfterHandle = CloseOnThirdButton; } }
protected virtual void OnDialogCompleted(DialogButtonClickedEventArgs e) { DialogCompleted?.Invoke(this, e); }