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 IEnumerable <ManagerTabItemSource> GetTabItemSourcesToApply() { //foreach (var managerTab in ManagerTabs.Where(tmpTab => !(tmpTab is OnlinePluginManagerTabItemSource))) foreach (var managerTab in ManagerTabs) { var oldState = state[managerTab.HeaderText].OrderBy(item => item.Item2); PluginManagerListViewModel tabItemController = (PluginManagerListViewModel)managerTab.Content.DataContext; for (int i = 0; i < tabItemController.ItemsSource.Count; i++) { var tmpPluginInfo = tabItemController.ItemsSource[i]; var oldPluginInfoState = oldState.FirstOrDefault(tmpState => tmpState.Item1.Equals(tmpPluginInfo.Plugin.GetType().FullName)); if (oldState == null || oldPluginInfoState.Item2 != i + 1 || oldPluginInfoState.Item3 != tmpPluginInfo.IsEnabled) { yield return(managerTab); break; } } } }
private static void TabItemBindingSource_Applying(ManagerTabItemSource tabItemSource) { PluginManagerListViewModel tabItemController = (PluginManagerListViewModel)tabItemSource.Content.DataContext; tabItemController.SyncPluginConfiguration(tabItemSource.CollectPlugins()); }