private void AddConfiguration(object obj) { Window mainWindow = Application.Current.MainWindow; if (mainWindow == null) { return; } ConfigurationPropertiesDialog dialog = new ConfigurationPropertiesDialog(); dialog.DataContext = new ConfigurationVM(this); dialog.Owner = mainWindow; if (dialog.ShowDialog() == true) { ConfigurationVM result = (ConfigurationVM)dialog.DataContext; Configurations.Insert(0, result); if (!IsExpanded) { IsExpanded = true; } result.IsSelected = true; Parent.EnvironmentIsDirty(); } }
private void ShowProperties(object obj) { if (Parent == null) { return; } Window mainWindow = Application.Current.MainWindow; if (mainWindow == null) { return; } ConfigurationPropertiesDialog dialog = new ConfigurationPropertiesDialog(); dialog.DataContext = Copy(); dialog.Owner = mainWindow; if (dialog.ShowDialog() == true) { ConfigurationVM result = (ConfigurationVM)dialog.DataContext; if (!result.IsDirty) { return; } var oldModel = Model; Model = result.Model; OnPropertyChanged(nameof(Alias)); OnPropertyChanged(nameof(OutPath)); OnPropertyChanged(nameof(BuildStrategy)); OnPropertyChanged(nameof(Release)); Parent?.Parent?.EnvironmentIsDirty(); } }