private void CreateInputValueComboBoxConfigState(String name, ControlInputConfigState state) { DeviceAndSelectionConfigState selectionState = (DeviceAndSelectionConfigState)state; CreateLabelForValueConfigState(name, state); ComboBox comboBox = new ComboBox() { Name = inputBoxPrefix + name, Style = (Style)gridMain.FindResource("styleContentComboBox"), IsEditable = true, IsReadOnly = true }; Grid.SetColumn(comboBox, state.LayoutPosition == InputConfigState.Position.LeftColumn ? 1 : 3); Grid.SetRow(comboBox, state.RowNumber); foreach (String entry in selectionState.AxisNames) { ComboBoxItem item = new ComboBoxItem(); item.Name = entry; item.Content = entry; comboBox.Items.Add(item); } gridCommands.Children.Add(comboBox); AddEventHandlersToControl(comboBox); }
private void CreateLabelForValueConfigState(String name, ControlInputConfigState state) { Label label = new Label() { Content = state.Name + ":", Style = (Style)gridMain.FindResource("styleContentLabel") }; Grid.SetColumn(label, state.LayoutPosition == InputConfigState.Position.LeftColumn ? 0 : 2); Grid.SetRow(label, state.RowNumber); gridCommands.Children.Add(label); }
private void CreateInputValueTextBoxConfigState(String name, ControlInputConfigState state) { CreateLabelForValueConfigState(name, state); TextBox textBox = new TextBox() { Name = inputBoxPrefix + name, IsReadOnly = true, Style = (Style)gridMain.FindResource("styleContentTextBox") }; Grid.SetColumn(textBox, state.LayoutPosition == InputConfigState.Position.LeftColumn ? 1 : 3); Grid.SetRow(textBox, state.RowNumber); gridCommands.Children.Add(textBox); AddEventHandlersToControl(textBox); }