【发布时间】:2016-08-27 00:08:18
【问题描述】:
我有一个像这样的单选按钮
<RadioButton
GroupName="A"
IsChecked="{Binding IsExternalAllEnabled, Mode=TwoWay, Converter={StaticResource BooleanNegationConverter}}" Margin="0,0,0,12">
<TextBlock
FontWeight="Normal"
Text="xx"
TextWrapping="Wrap"
VerticalAlignment="Stretch"
LineStackingStrategy="BaselineToBaseline"
LineHeight="18"
Margin="0,-1,0,0" />
但是,我只能在选中单选按钮时看到它,如果我将背景设置为某种颜色,我可以看到圆点(图片显示选中,例如如果设置为蓝色,则会有一个大蓝点覆盖内侧小圆点和圆边)。是这样的
知道为什么会发生这种情况吗?
我做了一些测试,发现基本上 RadioButton 不起作用。我是这样试的
<RadioButton GroupName="A" Content="XX" Margin="20,10,10,10"/>
但还是不行。
【问题讨论】:
-
为什么绑定
IsChecked? -
@FirstStep,谢谢!因为我需要在我的视图模型中使用状态。
-
RadioButton的模板是不是自定义的?嵌入式 TextBlock 的意义何在,而不是仅仅设置为 Content="XX"?需要更多信息来诊断。
-
@ChrisW。我尝试使用内容,但它不起作用。我更新了我的帖子。
-
RadioButton 的样式模板是自定义的吗?
标签: c# xaml radio-button uwp-xaml