我一直在尝试通过这个示例在 WPF 中使用命令,但遇到了一些问题。
我已经从 nuget 安装了 MVVMLight,并且一直在尽我所能。位我遇到问题。
我的视图模型:
 Class BoreModel
 {
    public ICommand Updatesql
    {
        get; internal set;
    }
    private void CreateUpdatesql()
    {
        Updatesql = new RelayCommand(UpdatesqlExecute);
    }
    private void UpdatesqlExecute()
    {
        FormSql.ProcessFormLocal(form1);
    }
    public BoreModel(string BusinessUnit, string TaskID)
    {
        CreateUpdatesql();
    }
}
我的 Xaml:
    <Button Click="{Binding Path=Updatesql}" Content="Button" HorizontalAlignment="Left" Margin="206,211,0,0" VerticalAlignment="Top" Width="75"/>
后面的代码:
    public MainWindow()
    {
        DataContext = new BoreModel();
        InitializeComponent();
    }
我收到一个指向底线的错误:"'Provide value on 'System.Windows.Data.Binding' threw an exception.' Line number '12' and line position '17'."
有任何想法吗?