I'm using a TabControl as my main workspace in an application, and I'd like to add a "Window" menu item that lists the headers of open tabs. The active (i.e. - focused) tab should be checked.
I've tried using an ItemsTemplate as follows:
<MenuItem Header="_Window" ItemsSource="{Binding ElementName=ux_workspace, Path=Items}">
<MenuItem.ItemTemplate>
<DataTemplate>
<MenuItem Header="{Binding Path=Header}" IsCheckable="True" IsChecked="{Binding IsFocused, Mode=OneWay}">
</DataTemplate>
</MenuItem.ItemTemplate>
</MenuItem>
Each MenuItem is then "nested", so to speak, inside of another MenuItem, which really isn't the intended result (the checkbox is in the header area, and there is a separate border around the internal item).
Is there a better way to do this?
Thanks in advance.