【发布时间】:2015-08-18 05:38:31
【问题描述】:
我正在尝试将CommandParameter 传递给我的ViewModel 中的方法。
如何做到这一点?
private void Open(object sender)
{
if (sender==this.objMainWindow.btnHistory)
{
objMainWindow.Container.Child = objHistory;
}
if (sender == this.objMainWindow.btnNew_Item)
{
objMainWindow.Container.Child = objNewItem;
}
if (sender == this.objMainWindow.btnSide_Effects)
{
objMainWindow.Container.Child = objSideEffect;
}
}
这是我在ViewModel 中的方法,我想通过CommandParameter。我使用CommandParameter 作为按钮。
【问题讨论】: