<Style
x:Key="Item"
BasedOn="{x:Null}"
TargetType="{x:Type ListBoxItem}">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="Height" Value="42" />
<Setter Property="Margin" Value="-2,0,0,0" />
<Setter Property="local:PeakHelper.IsRadioButton" Value="0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Grid x:Name="ListItem">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock
x:Name="ListItem_Text"
Grid.Column="0"
Padding="10,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="13"
FontWeight="Medium"
Foreground="{TemplateBinding Foreground}"
Text="{TemplateBinding Content}" />
<RadioButton
x:Name="PART_SelectVariable_1"
Grid.Column="1"
Content="Вариант 1"
Style="{StaticResource {x:Type ToggleButton}}" />
<RadioButton
x:Name="PART_SelectVariable_2"
Grid.Column="2"
Content="Вариант 2"
Style="{StaticResource {x:Type ToggleButton}}" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="ListItem" Property="Background" Value="#FF203FE6" />
<Setter TargetName="ListItem_Text" Property="Foreground" Value="White" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter TargetName="ListItem" Property="Background" Value="LightGray" />
<Setter TargetName="ListItem_Text" Property="Foreground" Value="DarkGray" />
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="ListItem" Property="Background" Value="#FFFDDFAD" />
<Setter TargetName="ListItem_Text" Property="Foreground" Value="#FFA47C38" />
</Trigger>
<DataTrigger Binding="{Binding IsChecked, ElementName=PART_SelectVariable_1}" Value="True">
<Setter Property="local:PeakHelper.IsRadioButton" Value="1" />
</DataTrigger>
<DataTrigger Binding="{Binding IsChecked, ElementName=PART_SelectVariable_2}" Value="True">
<Setter Property="local:PeakHelper.IsRadioButton" Value="2" />
</DataTrigger>
<DataTrigger Binding="{Binding IsPressed, ElementName=PART_SelectVariable_1}" Value="True">
<Setter Property="IsSelected" Value="True" />
<Setter TargetName="ListItem" Property="Background" Value="#FFE8E9F2" />
<Setter TargetName="ListItem_Text" Property="Foreground" Value="#FF9A9FB8" />
</DataTrigger>
<DataTrigger Binding="{Binding IsPressed, ElementName=PART_SelectVariable_2}" Value="True">
<Setter Property="IsSelected" Value="True" />
<Setter TargetName="ListItem" Property="Background" Value="#FFE8E9F2" />
<Setter TargetName="ListItem_Text" Property="Foreground" Value="#FF9A9FB8" />
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ListBoxItem -->
<Style x:Key="Item"
BasedOn="{x:Null}"
TargetType="{x:Type ListBoxItem}">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Stretch"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="Height" Value="42"/>
<Setter Property="Margin" Value="-2,0,0,0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Grid x:Name="ListItem">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock x:Name="ListItem_Text"
Grid.Column="0"
Padding="10,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="13"
FontWeight="Medium"
Foreground="{TemplateBinding Foreground}"
Text="{TemplateBinding Content}"/>
<RadioButton x:Name="PART_SelectVariable_1"
Grid.Column="1"
Content="Вариант 1"
IsEnabled="{TemplateBinding IsEnabled}"
Style="{StaticResource {x:Type ToggleButton}}"/>
<RadioButton x:Name="PART_SelectVariable_2"
Grid.Column="2"
Content="Вариант 2"
IsEnabled="{TemplateBinding IsEnabled}"
Style="{StaticResource {x:Type ToggleButton}}"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="ListItem" Property="Background" Value="#FF203FE6"/>
<Setter TargetName="ListItem_Text" Property="Foreground" Value="White"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter TargetName="ListItem" Property="Background" Value="LightGray"/>
<Setter TargetName="ListItem_Text" Property="Foreground" Value="DarkGray"/>
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="ListItem" Property="Background" Value="#FFFDDFAD"/>
<Setter TargetName="ListItem_Text" Property="Foreground" Value="#FFA47C38"/>
</Trigger>
<Trigger Property="local:Styles.IsRadioButton" Value="-1">
<Setter Property="DataContext" Value="0"/>
<Setter TargetName="PART_SelectVariable_1" Property="IsChecked" Value="false"/>
<Setter TargetName="PART_SelectVariable_2" Property="IsChecked" Value="false"/>
</Trigger>
<DataTrigger Binding="{Binding ElementName=PART_SelectVariable_1, Path=IsPressed}"
Value="True">
<Setter TargetName="ListItem" Property="Background" Value="#FFE8E9F2"/>
<Setter TargetName="ListItem_Text" Property="Foreground" Value="#FF9A9FB8"/>
<Setter Property="local:Styles.IsRadioButton" Value="1"/>
<Setter Property="IsSelected" Value="True"/>
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=PART_SelectVariable_2, Path=IsPressed}"
Value="True">
<Setter TargetName="ListItem" Property="Background" Value="#FFE8E9F2"/>
<Setter TargetName="ListItem_Text" Property="Foreground" Value="#FF9A9FB8"/>
<Setter Property="local:Styles.IsRadioButton" Value="2"/>
<Setter Property="IsSelected" Value="True"/>
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>