/// <summary> /// Initializes a new instance of the <see cref="SupplyCareSettingCtrlVm"/> class. /// </summary> /// <param name="mainWindowVm">The main window vm.</param> public SupplyCareSettingCtrlVm(MainWindowVm mainWindowVm) { this.SupplyCareSettingItems = new ObservableCollection <SupplyCareSettingItemVm>(); this.mainWindowViewModel = mainWindowVm; this.saveConfigurationCommand = new DelegateCommand(this.SaveConfiguration); this.loadConfigurationCommand = new DelegateCommand(this.LoadConfiguration); this.exportConfigurationCommand = new DelegateCommand(this.ExportConfiguration); this.importConfigurationCommand = new DelegateCommand(this.ImportConfiguration); var supplyCareWebServerSettingsCtrl = new SupplyCareWebServerSettingsCtrl(); this.supplyCareWebServerSettingsControlVm = new SupplyCareWebServerSettingsControlVm(mainWindowVm); var supplyCareSamplingRateSettingsCtrl = new SupplyCareSamplingRateSettingsCtrl(); this.supplyCareSamplingRateSettingsControlVm = new SupplyCareSamplingRateSettingsControlVm(mainWindowVm); var supplyCareSettingItemVm = new SupplyCareSettingItemVm(this, supplyCareWebServerSettingsCtrl, this.supplyCareWebServerSettingsControlVm, Resources.WebServer, true, @"SupplyCare WebServer Configuration"); supplyCareSettingItemVm.IsExpanded = false; this.SupplyCareSettingItems.Add(supplyCareSettingItemVm); supplyCareSettingItemVm = new SupplyCareSettingItemVm(this, supplyCareSamplingRateSettingsCtrl, this.supplyCareSamplingRateSettingsControlVm, Resources.OPCTimeSchedule, true, @"OPC time schedule"); supplyCareSettingItemVm.IsExpanded = false; this.SupplyCareSettingItems.Add(supplyCareSettingItemVm); }
/// <summary> /// Initializes a new instance of the <see cref="SupplyCareSettingCtrlVm"/> class. /// </summary> public SupplyCareSettingCtrlVm() { this.SupplyCareSettingItems = new ObservableCollection <SupplyCareSettingItemVm>(); var supplyCareSamplingRateSettingsCtrl = new SupplyCareSamplingRateSettingsCtrl(); var supplyCareSettingItemVm = new SupplyCareSettingItemVm(this, supplyCareSamplingRateSettingsCtrl, this.supplyCareSamplingRateSettingsControlVm, Resources.OPCTimeSchedule, true, @"OPC time schedule"); supplyCareSettingItemVm.IsExpanded = false; this.SupplyCareSettingItems.Add(supplyCareSettingItemVm); }
/// <summary> /// Selects the fis setting item. /// </summary> /// <param name="itemToSelect">The item to select.</param> public void SelectSupplyCareSettingItem(SupplyCareSettingItemVm itemToSelect) { foreach (var item in this.SupplyCareSettingItems) { if (item.ExpandButtonVisibility == Visibility.Visible) { item.IsExpanded = false; } } foreach (var item in this.SupplyCareSettingItems) { if (object.Equals(item, itemToSelect)) { item.IsExpanded = true; return; } } }