MVVMパターンでAvalonDatePickerコントロールを使用しています。このコントロールのCurrentlySelectedDateをViewModelのプロパティに次のようにバインドしています。
<my:DatePicker x:Name="dtpBirthDate" Cursor="Hand" DatesSelectionMode="Single" OverridesDefaultStyle="False" CurrentlySelectedDate="{Binding Path=BirthDate}" />
ここで、BirthDateは、ViewModelクラスのDateTime型のプロパティです。
public DateTime BirthDate
{
get { return _patient.BirthDate; }
set
{
if (value == _patient.BirthDate)
return;
_patient.BirthDate = value;
base.OnPropertyChanged("BirthDate");
}
}
それでも、ユーザーインターフェイスから値を変更しても、このプロパティの変更は発生しません。誰かが私が間違ったことを説明できますか?.NET3.0に制限されています。