Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I switch Telerik ribbonview elements according to the type of my child viewmodel?
    text
    copied!<p>I'm using an MVVM pattern for my WPF application. If the "home" view model, which controls the layout of my application's main window, I have a ChildViewModel property. This holds a viewmodel that can be switched according to what the user is doing. When they select menu items, the child view model switches and the main area of the screen (it's in an Outlook style) switches accordingly.</p> <p>I do this with a ContentControl and DataTemplate like this: (I'm only showing one of the embeddable views here to keep it short).</p> <pre><code>&lt;ContentControl Grid.Row="1" Grid.Column="1" Margin="3" Content="{Binding ChildViewModel}"&gt; &lt;ContentControl.Resources&gt; &lt;DataTemplate DataType="{x:Type vm:VersionsViewModel}"&gt; &lt;Embeddable:VersionsView /&gt; &lt;/DataTemplate&gt; &lt;/ContentControl.Resources&gt; &lt;/ContentControl&gt; </code></pre> <p>I also want to add a ribbon to my main window, using the Telerik RadRibbonView control. I want this to have some fixed tabs and buttons that are always visible. In addition, I want to add and remove entire tabs, and buttons within existing tabs, according to the type of child view model. I'd like this to be done in the view in a similar manner to the way I've done the content control, above.</p> <p>Is this possible? I've tried lots of things but got nowhere so far. I know I could do it by creating a huge "super ribbon" and binding visibility properties but this seems cludgey. I could also have multiple ribbons, each containing the common controls, but this would cause a maintenance problem.</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