更新整理
This commit is contained in:
@@ -62,7 +62,7 @@ public class CalendarDatePicker : Button
|
||||
}
|
||||
|
||||
var calendar = new System.Windows.Controls.Calendar();
|
||||
_ = calendar.SetBinding(
|
||||
calendar.SetBinding(
|
||||
System.Windows.Controls.Calendar.SelectedDateProperty,
|
||||
new Binding(nameof(Date))
|
||||
{
|
||||
@@ -70,7 +70,7 @@ public class CalendarDatePicker : Button
|
||||
Mode = BindingMode.TwoWay,
|
||||
UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged,
|
||||
});
|
||||
_ = calendar.SetBinding(
|
||||
calendar.SetBinding(
|
||||
System.Windows.Controls.Calendar.IsTodayHighlightedProperty,
|
||||
new Binding(nameof(IsTodayHighlighted))
|
||||
{
|
||||
@@ -78,7 +78,7 @@ public class CalendarDatePicker : Button
|
||||
Mode = BindingMode.TwoWay,
|
||||
UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged,
|
||||
});
|
||||
_ = calendar.SetBinding(
|
||||
calendar.SetBinding(
|
||||
System.Windows.Controls.Calendar.FirstDayOfWeekProperty,
|
||||
new Binding(nameof(FirstDayOfWeek))
|
||||
{
|
||||
@@ -102,7 +102,7 @@ public class CalendarDatePicker : Button
|
||||
AllowsTransparency = true,
|
||||
};
|
||||
|
||||
_ = _popup.SetBinding(
|
||||
_popup.SetBinding(
|
||||
Popup.IsOpenProperty,
|
||||
new Binding(nameof(IsCalendarOpen))
|
||||
{
|
||||
@@ -134,8 +134,8 @@ public class CalendarDatePicker : Button
|
||||
return;
|
||||
}
|
||||
|
||||
_ = popup.Focus();
|
||||
_ = Keyboard.Focus(popup.Child);
|
||||
popup.Focus();
|
||||
Keyboard.Focus(popup.Child);
|
||||
}
|
||||
|
||||
protected virtual void OnSelectedDatesChanged(object sender, SelectionChangedEventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user