请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
using System.Windows;
using System.Windows.Input;
namespace WPFBindingMVVM
{
public class MainViewModel : ViewModelBase
{
private string _text1;
public string Text1
{
get { return _text1; }
set
{
if (_text1 != value)
{
_text1 = value;
RaisePropertyChanged("Text1");
}
}
}
private ICommand _okCommand;
public ICommand OkCommand
{
get
{
if (_okCommand == null)
_okCommand = new RelayCommand(call => OnOk());
return _okCommand;
}
}
private void OnOk()
{
MessageBox.Show(Text1);
}
}
}