control size based on MVVM sample

Aug 18, 2010 at 7:56 PM

I am following the sample based on MVVM.  What I am trying to add is the ability to specify the size of my controls.

I did some research and found that <ribbon:RibbonGroup.GroupSizeDefinitions> is probably the way to go.  So I was hopping to generate this based on my mvvm view model.

So what I tried was something like:

    <!-- RibbonGroup -->
    <Style TargetType="{x:Type ribbon:RibbonGroup}" BasedOn="{StaticResource RibbonControlStyle}">
        <Setter Property="GroupSizeDefinitions" Value="{Binding Converter={StaticResource SizeInGroupConverter}, Path=SizeInGroupData}"/>
        <Setter Property="QuickAccessToolBarId" Value="{Binding Label}" />
        <Setter Property="Header" Value="{Binding Label}" />
        <Setter Property="ItemsSource" Value="{Binding ControlDataCollection}" />        

Where SizeInGroupConverter is a converter that will turn my mvvm class into a GroupSizeDefinitions.

Compiles and runs no problem, but it doesn't seem to have any affect.

Anyone else tried this?  Have a better solution?


Sep 23, 2010 at 9:31 AM

I encountered the same problem.  :-(