tags:

views:

26

answers:

1

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.

A: 

Those bindings are all related to selection. I'm not certain how the Ribbon operates but it doesn't appear that what you are trying to do will give you the results you are after.

In addition the ObservableCollection<Remark> is only relative from an Add/Remove stance when making use of binding. It will not propagate changes to the items within the collection. If you were wanting that functionality you will need to implement INotifyPropertyChanged on the Remark object, then raise a property changed notification as needed.

Aaron
@Aaron - the Remark object does implement INotifyPropertyChanged interface. I guess that is why I am confused as to why it isn't working. The properties I'm using for databinding seem to be the only properties avaialable. I'm having a very difficult time finding any documentation for the ribbon component that shows databinding with it.
John Kraft
@John I have done some Ribbon work. You are using the latest (final) from earlier August correct? I can dig up to see what I have...for examples
Aaron
@Aaron - yes. I'm using the final release from August. Most of the documentation and examples I've found pertain to the beta from last year; and most of the properties in those examples just don't exist anymore.
John Kraft
@John have been fooling around, no luck thus far, trying varying things...not sure if it is possible. I'd suggest posting on MSDN site...one of the MSFT folks will most likely respond, once you get the answer come update this post so we can all learn
Aaron