private static void TabItemBindingSource_PluginsSelected(ManagerTabItemSource tabItemSource, bool isSelected) { PluginManagerListViewModel tabItemController = (PluginManagerListViewModel)tabItemSource.Content.DataContext; foreach (var pluginModel in tabItemController.ItemsSource) { pluginModel.IsEnabled = isSelected; } }
private void AddProviderManager(ManagerTabItemSource tabItem) { UserControl contentList = null; if (tabItem.DelayLoad) { //contentList = new OnlinePluginListUserControl(); //contentList.DataContext = tabItem.GetBindingSource(); } else { var bindingSource = tabItem as ManagerTabItemSource; if (bindingSource != null) { bindingSource.Applying = new Action <ManagerTabItemSource>(TabItemBindingSource_Applying); bindingSource.PluginsSelected = new Action <ManagerTabItemSource, bool>(TabItemBindingSource_PluginsSelected); contentList = new PluginManagerListUserControl(); contentList.DataContext = new PluginManagerListViewModel(bindingSource.CollectPlugins()); } } tabItem.Content = contentList; ManagerTabs.Add(tabItem); }
private static void TabItemBindingSource_Applying(ManagerTabItemSource tabItemSource) { PluginManagerListViewModel tabItemController = (PluginManagerListViewModel)tabItemSource.Content.DataContext; tabItemController.SyncPluginConfiguration(tabItemSource.CollectPlugins()); }