public MainWindow() { InitializeComponent(); DataContext = new DataCont(); { PortsBox.SelectedIndex = 1; BaudRateBox.SelectedIndex = 3; ParityBox.SelectedIndex = 0; DataBitsBox.SelectedIndex = 1; StopBitsBox.SelectedIndex = 1; } }
private void RefreshBtn_Click(object sender, RoutedEventArgs e) { DataContext = new DataCont(); PortsBox.GetBindingExpression(ComboBox.ItemsSourceProperty) .UpdateTarget(); }