/// <summary> /// Initializes a new instance of the <see cref="BridgeSettingCtrlVm"/> class. /// </summary> public BridgeSettingCtrlVm() { this.BridgeSettingItems = new ObservableCollection <BridgeSettingItemVm>(); var bridgeGatewaySettingsCtrl = new BridgeGatewaySettingsCtrl(); var bridgeSettingItem = new BridgeSettingItemVm(this, bridgeGatewaySettingsCtrl, this.bridgeGatewaySettingsControlVm, Resources.Gateway, true, @"Gateway"); bridgeSettingItem.IsExpanded = false; this.BridgeSettingItems.Add(bridgeSettingItem); }
/// <summary> /// Selects the fis setting item. /// </summary> /// <param name="itemToSelect">The item to select.</param> public void SelectBridgeSettingItem(BridgeSettingItemVm itemToSelect) { foreach (var item in this.BridgeSettingItems) { if (item.ExpandButtonVisibility == Visibility.Visible) { item.IsExpanded = false; } } foreach (var item in this.BridgeSettingItems) { if (object.Equals(item, itemToSelect)) { item.IsExpanded = true; return; } } }
/// <summary> /// Initializes a new instance of the <see cref="BridgeSettingCtrlVm"/> class. /// </summary> /// <param name="mainWindowVm">The main window vm.</param> public BridgeSettingCtrlVm(MainWindowVm mainWindowVm) { this.BridgeSettingItems = new ObservableCollection <BridgeSettingItemVm>(); 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 bridgeGatewaySettingsCtrl = new BridgeGatewaySettingsCtrl(); this.bridgeGatewaySettingsControlVm = new BridgeGatewaySettingsControlVm(mainWindowVm); var bridgeSettingItem = new BridgeSettingItemVm(this, bridgeGatewaySettingsCtrl, this.bridgeGatewaySettingsControlVm, Resources.Gateway, true, @"Gateway"); bridgeSettingItem.IsExpanded = true; this.BridgeSettingItems.Add(bridgeSettingItem); }