【发布时间】:2013-01-02 13:08:23
【问题描述】:
我对 Silverlight5 和 MVVM 模式有疑问..
在我的用户控件窗口中,我有 2 个单选按钮控件,我使用 GroupName="sex" 将单选按钮控件组合在一起。
语法是:
<RadioButton IsChecked="{Binding EntityValue,Mode=TwoWay}" Content="Male"
GroupName="Sex"
Visibility="{Binding DataTypeID, Converter={StaticResource radioconverter}}"/>
<RadioButton IsChecked="{Binding EntityValue,Mode=TwoWay}" Content="Female"
GroupName="Sex"
Visibility="{Binding DataTypeID, Converter={StaticResource radioconverter}}"/>
我已成功使用实体框架将检查值插入到数据库中。
例如:我的数据库将如下所示:
CustomerID | CustomerName | EntityValue |
------------------------------------------
1 | raj | Male
2 | reena | Female
数据库名称为:CDetails
如果我选择了customerID=1 表示值Male 将绑定到我的radioButton1
和
如果我选择了customerID=2 表示值Female 将绑定到我的radioButton2
这怎么可能?
【问题讨论】:
标签: silverlight entity-framework mvvm