Pass command parameter to method in ViewModel in WPF?
问题 I am trying to pass CommandParameter to the method in my ViewModel . How to do this? 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; } } This is my meyhod in ViewModel that I want to pass CommandParameter . I use