【发布时间】:2014-08-24 11:13:43
【问题描述】:
我有两个单选按钮。我只想在 viewmodel 中捕获选定的单选按钮值。我已经定义了一个 GetLOB() 方法,我想在其中捕获 commandParameter 值。
这是我的代码
<RadioButton GroupName="Os" Content="Payroll" IsChecked="{Binding ObjEntrySheetManagerViewModel.CheckedProperty}" Command="LobType" CommandParameter="Payroll" Grid.Row="4" Grid.Column="0" Margin="25,15,0,0"/>
<RadioButton GroupName="Os" Content="Sales" Grid.Row="4" Grid.Column="1" Command="LobType" CommandParameter="Payroll" Margin="5,15,0,0"/>
private RelayCommand _LobType;
public ICommand LobType
{
get
{
if (_LobType == default(RelayCommand))
{
_LobType = new RelayCommand(GetLOB);
}
return _LobType;
}
}
private void GetLOB()
{
}
【问题讨论】:
标签: wpf