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}}"/>
Entity Framework を使用して、チェックされた値をデータベースに正常に挿入しました。
例: 私のデータベースは次のようになります。
CustomerID | CustomerName | EntityValue |
------------------------------------------
1 | raj | Male
2 | reena | Female
データベース名:CDetails
値を自分にバインドするcustomerID=1
手段を選択した場合Male
radioButton1
と
customerID=2
値Female
を自分にバインドする手段を選択した場合radioButton2
それはどのように可能ですか?