private void clearButton_Click(object sender, RoutedEventArgs e) { ApplicationViewModel viewModel = DataContext as ApplicationViewModel; viewModel.ClearResolvedConflicts(); }
internal NewRuleView(ApplicationViewModel appViewModel) : this(appViewModel, null) { }
private void conflictsListView_SelectionChanged(object sender, SelectionChangedEventArgs e) { ListBox list = sender as ListBox; ApplicationViewModel viewModel = DataContext as ApplicationViewModel; if (viewModel != null) { if (list.SelectedItems.Count > 0) { var items = list.SelectedItems.Cast <ConflictRuleViewModel>(); var v = items.GroupBy(x => x.ConflictType); var v2 = items.GroupBy(x => x.MigrationSource); if (v.Count() == 1 && v2.Count() == 1) { ConflictHelpProvider.SetHelpPath(this, Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName), @"Documentation\TfsIntegration.chm")); ConflictHelpProvider.SetHelpKeyword(this, items.First().ConflictType); string bestScope = FindBestScope(items); if (bestScope != null) { viewModel.CurrentRule = new ConflictRuleViewModel(items.First()); viewModel.CurrentRule.Scope = bestScope; if (items.FirstOrDefault(x => x.IsResolved != ResolvedStatus.Resolved) == null) { viewModel.CurrentRule.IsResolved = ResolvedStatus.Resolved; viewModel.ResetResolvableConflicts(); } else { viewModel.CurrentRule.SetResolvableConflicts(); } } else { viewModel.CurrentRule = null; viewModel.ResetResolvableConflicts(); } } else { viewModel.CurrentRule = null; viewModel.ResetResolvableConflicts(); } } else { viewModel.CurrentRule = null; viewModel.ResetResolvableConflicts(); } /* * Selector listView = sender as Selector; * if (listView != null) * { * if (listView.SelectedItem != null) * { * ConflictRuleViewModel conflict = listView.SelectedItem as ConflictRuleViewModel; * Debug.Assert(conflict != null); * conflict.SetResolvableConflicts(); * } * else * { * ApplicationViewModel viewModel = DataContext as ApplicationViewModel; * Debug.Assert(viewModel != null); * viewModel.ResetResolvableConflicts(); * } * } * */ } }