阅读背景:

在没有命令的情况下在ViewModel中调用方法

来源:互联网 

I have the following scenario:

我有以下情况:

public class MyCommand : ICommand
{
    MyViewModel _viewModel;

    public MyCommand(MyViewModel viewModel)
    {
        _viewModel = viewModel;
    }

    public bool CanExecute(object parameter)
    {
        return true;
    }

    public event EventHandler CanExecuteChanged;

    public void Execute(object parameter)
    {
        _viewModel.SomeMethod();
    }
}
publ



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: