private void Execute_DialogLoad(View.LoadCardPackDialog dialog) { if (this.CardPackList_SelectedIndex == -1) { dialog.DialogResult = false; } else { dialog.DialogResult = true; } }
private void Execute_LoadCardPack() { View.LoadCardPackDialog newDialog = new View.LoadCardPackDialog(); LoadCardPackDiagViewModel diagVM = new LoadCardPackDiagViewModel(newDialog); newDialog.DataContext = diagVM; if (newDialog.ShowDialog() == true) { this.lobbyClient.Deck = diagVM.GetSelectedItem(); this.OnPropertyChanged("ActivePackName"); } }
private void Execute_LoadCardPack() { View.LoadCardPackDialog newDialog = new View.LoadCardPackDialog(); LoadCardPackDiagViewModel diagVM = new LoadCardPackDiagViewModel(newDialog); newDialog.DataContext = diagVM; if (newDialog.ShowDialog() == true) { this.QnAModel.CardPackItem = diagVM.GetSelectedItem(); this.Card_SelectedIndex = 0; this.OnPropertyChanged("CardTitleList"); } }
private void Execute_LoadCardPack() { View.LoadCardPackDialog newDialog = new View.LoadCardPackDialog(); LoadCardPackDiagViewModel diagVM = new LoadCardPackDiagViewModel(newDialog); newDialog.DataContext = diagVM; if (newDialog.ShowDialog() == true) { { this.QnAModel = new Model.QnAModel(diagVM.GetSelectedItem()); } } this.OnPropertyChanged("ActiveCardPack"); }
private void Execute_ExportCardPack() { View.LoadCardPackDialog newDialog = new View.LoadCardPackDialog(); LoadCardPackDiagViewModel diagVM = new LoadCardPackDiagViewModel(newDialog); newDialog.DataContext = diagVM; CardPack SelectedCardPack; if (newDialog.ShowDialog() == true) { SelectedCardPack = diagVM.GetSelectedItem(); System.Windows.Forms.SaveFileDialog saveDialog = new System.Windows.Forms.SaveFileDialog(); saveDialog.Filter = "Card Pack Zip(*.lcpz)|*.lcpz|Any File (*.*)|*.*"; saveDialog.Title = "export card pack"; if (saveDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { CardPack.ExportCardPack(SelectedCardPack.PackName, saveDialog.FileName); } } }
private void Execute_DialogCancel(View.LoadCardPackDialog dialog) { dialog.DialogResult = false; }
public LoadCardPackDiagViewModel(View.LoadCardPackDialog newDialog) { this.Command_DialogLoad = new DelegateCommand(x => this.Execute_DialogLoad(newDialog)); this.Command_DialogCancel = new DelegateCommand(x => this.Execute_DialogCancel(newDialog)); this.CardPackList_SelectedIndex = -1; }