Note that there are some explanatory texts on larger screens.

plurals
  1. PORibbonComboBox doesn't update SelectedValue
    text
    copied!<p>I’ve got a ribbon combobox (MS Ribbon OpenSource project, .Net 4.0) which is data bound to a property of my viewmodel like this:</p> <p><em>XAML</em>:</p> <pre><code>&lt;ribbon:RibbonComboBox SelectionBoxWidth="130" Margin="3,0"&gt; &lt;ribbon:RibbonGallery SelectedValue="{Binding Source={StaticResource ViewModel}, Path=Document, Converter={StaticResource DocumentToDocumentNameConverter}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"&gt; &lt;ribbon:RibbonGalleryCategory ItemsSource="{Binding Source={StaticResource ViewModel}, Path=Documents, Converter={StaticResource DocumentToDocumentNamesConverter}}"&gt; &lt;/ribbon:RibbonGalleryCategory&gt; &lt;/ribbon:RibbonGallery&gt; &lt;/ribbon:RibbonComboBox&gt; </code></pre> <p><em>ViewModel</em>:</p> <pre><code>public ViewModel { #region Fields private TestDocument _Document; #endregion #region Properties public TestDocument Document { get { return ModelClass.SelectedDocument; } set { if (value != null &amp;&amp; value != _Document) { _Document = value; OnPropertyChanged("Document"); } } } #endregion } </code></pre> <p>That works good, if I select another value in the ComboBox the converter is entered and the value shown.</p> <p>But if I set the property in the ViewModel like this</p> <pre><code>Document = new TestDocument("DocumentName"); </code></pre> <p>the ComboBox doesn't show the name as selected.</p> <p>Do you have any suggestions? I've even tried to bind SelectedItem instead of SelectedValue but this doesn't fixed the problem. Have I forgotten something?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload