Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
40
"Checks" Not Rendered When Using ToggleButtonTool as DataTemplate for MenuTool
posted

I can create a MenuTool in the 'traditional' manner and it works fine in this toolbar. As example:

<Ribbon:MenuTool Caption="Something"
                 Ribbon:RibbonGroup.MaximumSize="ImageAndTextNormal">
  <Ribbon:ToggleButtonTool Caption="First" IsChecked="True" />
  <Ribbon:ToggleButtonTool Caption="Second" IsChecked="False" />
  <Ribbon:ToggleButtonTool Caption="Third" IsChecked="True" />
</Ribbon:MenuTool>

...works fine.

On the other hand, if I am binding a collection of items to a MenuTool in the same Ribbon and using ToggleButtonTool as the ItemTemplate for it, everything functions except the check-mark...

In the Ribbon:
<Ribbon:MenuTool Caption="Show/Hide Items"
                 Ribbon:RibbonGroup.MaximumSize="ImageAndTextNormal"
                 ItemsSource="{Binding Items}"
                 ItemTemplate="{StaticResource MenuItem}" />

In the ResourceDictionary:
<DataTemplate x:Key="MenuItem">
  <Ribbon:ToggleButtonTool IsChecked="{Binding IsVisible}"
                           Caption="{Binding FullName}" />
</DataTemplate>

I can use a CheckBox without problem, but it doesn't look as good. Any thoughts on this?

Thank you,
rich

Parents Reply Children