Windows Phone 8.1单选按钮不工作

本文关键字:工作 单选按钮 Phone Windows | 更新日期: 2023-09-27 18:04:28

我有StackPanel两个单选按钮。IsChecked不工作/签入在屏幕上。

<RadioButton Name="SettingsRB128" BorderBrush="Aqua" IsChecked="{Binding SettingsRB128}"></RadioButton>
<RadioButton Name="SettingsRB64" BorderBrush="Aqua" IsChecked="True">

但是在代码中,value是正确的

Debug.WriteLine("{0}/{1}", SettingsRB128.IsChecked, SettingsRB64.IsChecked)

如果删除

BorderBrush="Aqua"

Windows Phone 8.1单选按钮不工作

解决方案

设计师1. 选择radiobutton2. 右键点击"编辑模板"-"编辑副本"-"确定"

改变
<SolidColorBrush x:Key="PhoneRadioCheckBoxBrush" Color="Magenta"/>

<VisualState x:Name="Checked">
    <Storyboard>
        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="CheckBackground">
            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
        </ObjectAnimationUsingKeyFrames>
    </Storyboard>
</VisualState>
<VisualState x:Name="Unchecked">
    <Storyboard>
        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="CheckMark">
            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
        </ObjectAnimationUsingKeyFrames>
    </Storyboard>
</VisualState>