我正在使用微型和小型设备,希望能够让一个纽埃公司改写日期。
XAML Code: Binding on DatePicker
SelectedDate="{Binding InactiveDate, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
DisplayDate="{Binding InactiveDate, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
对布顿具有约束力的文书:
<Button Margin="10" Command="{Binding SubmitCommand}"
View Model Code: I am using a DelegateCommand for button click
意见模式 代表的初始
SubmitCommand = new DelegateCommand(OnSubmitRequested, AllowSubmit, Controller);
允许执行
private bool AllowSubmit()
{
return InactiveDate != null;
}
活性财产实施
public DateTime? InactiveDate
{
get
{
return _inactiveDate;
}
set
{
_inactiveDate = value;
SubmitCommand.RaiseCanExecuteChanged();
PropertyChanged(this, new PropertyChangedEventArgs("InactiveDate"));
}
}
<代码>SubmitCommand.RaiseCanExecuteChanged(>>,一旦我进入日期,则使纽伦成为可能,但并未发生。