I am working on a program settings page. Part of the program's operations detect clicks to do two different actions. The two actions cannot be triggered by the same click type, it wouldn't make sense for the program flow to be triggered and cycled by the same mouse button.
The two radio groups are actually styled listboxes (because apparently binding to radiobuttons is horrible). Here is my code for representing the boxes in xaml and my style element used to style them. Currently I only have the style to align them push the radio buttons a bit to the right of the header. I know I need to add a style for isenabled, and use a binding in the value somehow
<Style x:Key="SpacedRadioButtonListItem" TargetType="ListBoxItem" BasedOn="{StaticResource RadioButtonListItem}">
<Setter Property="Margin" Value="10,0,0,0" />
<Setter Property="IsEnabled" Value="<I know something goes here, but don't know what>" />
</Style>
<!------snip-------->
<Label Grid.Row="6" Grid.Column="0" FontWeight="Bold">Trigger Button</Label>
<ListBox Grid.Row="7" Grid.Column="0" Style="{StaticResource RadioButtonList}"
ItemContainerStyle="{StaticResource SpacedRadioButtonListItem}"
SelectedItem="{Binding Source={x:Static local:DropZone.Settings}, Path=TriggerButton, Mode=TwoWay}"
ItemsSource="{vc:EnumToCollection EnumType={x:Type local:MouseButtonTriggers}}" >
</ListBox>
<Label Grid.Row="8" Grid.Column="0" FontWeight="Bold">Layout Cycle Button</Label>
<ListBox Grid.Row="9" Grid.Column="0" Style="{StaticResource RadioButtonList}"
ItemContainerStyle="{StaticResource SpacedRadioButtonListItem}"
SelectedItem="{Binding Source={x:Static local:DropZone.Settings}, Path=SwapButton, Mode=TwoWay}"
ItemsSource="{vc:EnumToCollection EnumType={x:Type local:MouseButtonTriggers}}" >
</ListBox>
I know that I have to put something is the "Value" property of the second setter above, and am certain it's a binding, but I don't know what to begin searching for in order to figure out the code I need. The confounding issue is the fact that if Trigger button is left mouse click, I don't want to allow the user to set layout cycle button to left mouse click, same for middle or right mouse click, the user should not be able to select the same button for both actions. I can write a rule in c# if I can figure out how to bind it as a behavior to the xaml; my assumption is I could just say "oh, is the other setting this? Well if so this option is disabled"