I'd like to have a menu tool containing a dynamic list of radio button tools.
I've made a little example to illustrate the problem:
<Window x:Class="InfraSandbox.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Ribbon="clr-namespace:Infragistics.Windows.Ribbon;assembly=Infragistics3.Wpf.Ribbon.v8.2" xmlns:System="clr-namespace:System;assembly=mscorlib" Title="Window1" Height="300" Width="300"> <Window.Resources> <x:Array x:Key="data" Type="System:String"> <System:String>B1</System:String> <System:String>B2</System:String> <System:String>B3</System:String> </x:Array> </Window.Resources> <Grid> <Ribbon:XamRibbon> <Ribbon:RibbonTabItem Header="Tab"> <Ribbon:RibbonGroup Caption="Group"> <Ribbon:MenuTool Caption="MenuTool 1"> <Ribbon:RadioButtonTool Caption="A1" IsChecked="True"/> <Ribbon:RadioButtonTool Caption="A2"/> <Ribbon:RadioButtonTool Caption="A3"/> </Ribbon:MenuTool> <Ribbon:MenuTool Caption="MenuTool 2" ItemsSource="{StaticResource data}"> <Ribbon:MenuTool.ItemTemplate> <DataTemplate> <Ribbon:RadioButtonTool Caption="{Binding Path=.}"/> </DataTemplate> </Ribbon:MenuTool.ItemTemplate> </Ribbon:MenuTool> </Ribbon:RibbonGroup> </Ribbon:RibbonTabItem> </Ribbon:XamRibbon> </Grid></Window>
Is it possible to do it this way?
The items displayed in the dropdown of a menu tool aren't actually tools - not button tools anyway - they are ToolMenuItem instances. So you would have to make those menu items checkable and bind the IsChecked of the radiobuttontool to the ischecked of the menu item.
e.g.
The XAML you provided is being truncated by the forum web page. Can you repost it without lines which are very long?