0

I have a WPF ComboBox bound to a ReactiveList and a registered view for a model (IViewFor<MyModel>), so it correctly shows the list when the combobox is opened.

The problem is that the selected value is not shown in the combobox when it is closed.

XAML

<DockPanel>
    <ComboBox x:Name="SourceSystemDatabases" />
</DockPanel>

Binding

this.OneWayBind(ViewModel, vm => vm.SourceDatabases, view => view.SourceSystemDatabases.ItemsSource);

Opened combobox

Opened combobox

Closed combobox with no text

closed combobox with no next

bradgonesurfing
  • 30,949
  • 17
  • 114
  • 217
philous
  • 3
  • 3
  • 1
    Did you define a custom ComboBoxItem style or ItemTemplate or why are the items green? – mm8 Jan 12 '17 at 11:57
  • @mm8 Yes, I have registered a control for the model with `container.Register, MyModelComboBoxItemTemplate>();` as ReactiveUI overrides item templates. I expect it to use the same template for the selected item rendering when combobox is closed. – philous Jan 12 '17 at 12:10
  • You should read this: http://stackoverflow.com/help/mcve – mm8 Jan 12 '17 at 13:20
  • @mm8 what exactly is not clear in a question? – philous Jan 12 '17 at 13:40
  • How MyModelComboBoxItemTemplate is defined for example. – mm8 Jan 12 '17 at 13:46
  • Do you also have a binding for the SelectedIndex. If that is incorrectly done then it may always be set to -1 nomatter what you select in the drop down. – bradgonesurfing Jan 31 '17 at 15:28
  • The answer is here: https://stackoverflow.com/a/45133895/104877 – Stanley.Goldman Oct 20 '18 at 18:10

0 Answers0