Search code examples
c#wpfribbon

RibbonComboBox Text Not Retaining Edits


I have the following xaml in my ui:

<ribbon:RibbonGallery SelectedValue="{Binding Text}"
                      SelectedValuePath="Content"
                      SelectedItem="{Binding SelectedRemark, Mode=TwoWay}"
                      MaxColumnCount="1">
    <ribbon:RibbonGalleryCategory ItemsSource="{Binding Remarks}" DisplayMemberPath="Text"/>
</ribbon:RibbonGallery>

Both SelectedRemark and Remarks are properties on my view model; and Remarks is an ObservableCollection<Remark>.

It will display properly, and I can edit the text in the combobox. However, as soon as the combobox loses focus, it reverts back to whatever the the original text was.

I'm new to WPF, and cannot figure out what am I doing wrong.


Solution

  • Beware of a bug that causes the selectionchanged event to fire after the mouse moves. See this bug report: https://connect.microsoft.com/VisualStudio/feedback/details/666352/