public void Execute(object parameter) { BinderBase target = (BinderBase)parameter; EmployeeLeaveViewModel model = (EmployeeLeaveViewModel)target.DataContext; model.EmployeeName = "I've been changed by the command"; }
private void SubmitWithUnbind(object parameter) { //If you set the UpdateSourceTrigger to explicit in the view markup, the following code //will explicity update the viewmodel from the view. (ie, Execute an Unbind) BinderBase binder = parameter as BinderBase; binder.ExecuteUnbind(); //this is where you'd talk to the service layer. this.UserMessage = "The registration has been submitted to the service layer"; this.ShowInputForm = false; }