
I have a radiobuttonlist that I want to twoway bind to an index that I store in the application settings. The index indicates which radiobutton is selected. I have tried several approches but they don't work.
The Last I have tried is:with the following for the listitem
The problem is that both radiobuttons are selected. Is there a simple way to implement this?
Thanks
Bob
The Last I have tried is:
<Style x:Key="RadioButtonListStyle" TargetType="ListBox">
<Style.Resources>
<Style TargetType="ListBoxItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<RadioButton
Content="{TemplateBinding ContentPresenter.Content}"
Foreground="WhiteSmoke"
IsChecked="{Binding Path=IsSelected,
RelativeSource={RelativeSource TemplatedParent},
Mode=TwoWay}" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Style.Resources>
</Style>
<shared:RadioButtonList Name="DisplayTypeControl" Margin="40,0,10,10" SelectionChanged="DisplayTypeChange_SelectionChanged"
IsHitTestVisible="True" Style="{StaticResource RadioButtonListStyle}">
<ListBoxItem Name="TimeseriesSelect" IsSelected="{Binding Source={x:Static properties:Settings.Default}, Path=Default.DataType}">Timeseries</ListBoxItem>
<ListBoxItem Name="SpectrumSelect" IsSelected="{Binding Source={x:Static properties:Settings.Default}, Path=Default.DataType}">Spectrum</ListBoxItem>
</shared:RadioButtonList>
Thanks
Bob