Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
通常我使用 RelayCommand 或 DelegateCommand 在 ViewModel 中(或者在如果您不使用 MVVM,则为代码隐藏)
ViewModel
private ICommand _customCommand; public ICommand CustomCommand { get { if (_customCommand == null) { _customCommand = new RelayCommand( CustomCommandHandler, CanCustomCommandExecute); } return _customCommand; } } private void CustomCommandHandler() { // Execute Command } private bool CanCustomCommandExecute() { // Return true/false if the command can execute or not }
XAML:
<Button Command="{Binding CustomCommand}" />
Usually I use a RelayCommand or DelegateCommand in the ViewModel (or in the Code-behind if you're not using MVVM)
XAML:
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(1)
通常我使用 RelayCommand 或 DelegateCommand 在
ViewModel
中(或者在如果您不使用 MVVM,则为代码隐藏)XAML:
Usually I use a RelayCommand or DelegateCommand in the
ViewModel
(or in the Code-behind if you're not using MVVM)XAML: