public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { SystemComponentIndex index = (SystemComponentIndex)value; switch (index) { case SystemComponentIndex.Connections: case SystemComponentIndex.Misc: case SystemComponentIndex.Proposal: case SystemComponentIndex.Controllers: case SystemComponentIndex.Valves: return(2); default: return(1); } }
private void componentComboBox_Selected(object sender, RoutedEventArgs e) { ComboBox comboBox = sender as ComboBox; EquipmentListControl eList = UIHelpers.FindVisualChild <EquipmentListControl>(this); if (eList != null) { if (eList.SelectedItem != null) { eList.SelectedItem = null; Storyboard moveBack = (Storyboard)FindResource("systemMoveBack"); moveBack.Begin(); } } ControllerListControl cList = UIHelpers.FindVisualChild <ControllerListControl>(this); if (cList != null) { cList.SelectedItem = null; } PanelListControl pList = UIHelpers.FindVisualChild <PanelListControl>(this); if (pList != null) { pList.SelectedItem = null; } SystemComponentIndex selectedValue = (SystemComponentIndex)comboBox.SelectedValue; if (selectedValue == SystemComponentIndex.Connections || selectedValue == SystemComponentIndex.Misc || selectedValue == SystemComponentIndex.Proposal || selectedValue == SystemComponentIndex.Controllers || selectedValue == SystemComponentIndex.Valves) { Storyboard move = (Storyboard)FindResource("systemMove"); move.Begin(); } }