У меня есть этот код:WPF Как установить стиль на RadioButton?
<GroupBox Grid.Column="1" BorderThickness="0,0,0,0" HorizontalAlignment="Right">
<ItemsControl FontWeight="Normal"
ItemsSource="{Binding Path=AvailableTipologieDifficolta}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<RadioButton
Content="{Binding Path=DisplayName}"
IsChecked="{Binding Path=IsSelected}"
GroupName="Feedback"
Margin="10,3.5"
Style="{StaticResource RadioButtonTemplate}"
/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</GroupBox>
Это стиль RadioButton:
<Style TargetType="RadioButton" x:Key="RadioButtonTemplate">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<RadioButton Foreground="White" FontSize="20">
<ContentPresenter/>
</RadioButton>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Так что, когда я пытаюсь запустить свой код, у меня есть это:
о Opzione 1 о Opzione 2
Я могу выбрать каждый вариант, но это невозможно. Если я удалю этот код Style = "{StaticResource RadioButtonTemplate}", я могу выбрать один из вариантов.
Можем ли мы мне помочь?
* Мы можем помочь мне? * ... использовать слова, чтобы объяснить вашу проблему и ваш желаемый результат. – Sheridan