private void NGDPHostChange(object sender, RoutedEventArgs e) { if (sender is MenuItem menuItem) { foreach (PatchHost node in NGDPPatchHosts.Where(x => x.Active && x.GetHashCode() != (menuItem.DataContext as PatchHost).GetHashCode())) { node.Active = false; } CollectionViewSource.GetDefaultView(NGDPPatchHosts).Refresh(); } }
public MainWindow() { ViewContext = SynchronizationContext.Current; NGDPPatchHosts = new NGDPPatchHosts(); RecentLocations = new RecentLocations(); ProgressInfo = new ProgressInfo(); CASCSettings = new CASCSettings(); ProductAgent = new ProductLocations(); ProgressSlave.OnProgress += UpdateProgress; if (!NGDPPatchHosts.Any(x => x.Active)) { NGDPPatchHosts[0].Active = true; } InitializeComponent(); DataContext = this; // FolderView.ItemsSource = ; // FolderItemList.ItemsSource = ; }