Browse Source

SelectedDate and SelectedTime => TwoWay by default

Fixes #3407
pull/6022/head
Deadpikle 5 years ago
parent
commit
12c37270ee
  1. 4
      src/Avalonia.Controls/DateTimePickers/DatePicker.cs
  2. 4
      src/Avalonia.Controls/DateTimePickers/TimePicker.cs

4
src/Avalonia.Controls/DateTimePickers/DatePicker.cs

@ -2,6 +2,7 @@
using Avalonia.Controls.Primitives;
using Avalonia.Controls.Shapes;
using Avalonia.Controls.Templates;
using Avalonia.Data;
using Avalonia.Interactivity;
using System;
using System.Collections.Generic;
@ -88,7 +89,8 @@ namespace Avalonia.Controls
/// </summary>
public static readonly DirectProperty<DatePicker, DateTimeOffset?> SelectedDateProperty =
AvaloniaProperty.RegisterDirect<DatePicker, DateTimeOffset?>(nameof(SelectedDate),
x => x.SelectedDate, (x, v) => x.SelectedDate = v);
x => x.SelectedDate, (x, v) => x.SelectedDate = v,
defaultBindingMode: BindingMode.TwoWay);
// Template Items
private Button _flyoutButton;

4
src/Avalonia.Controls/DateTimePickers/TimePicker.cs

@ -2,6 +2,7 @@
using Avalonia.Controls.Primitives;
using Avalonia.Controls.Shapes;
using Avalonia.Controls.Templates;
using Avalonia.Data;
using System;
using System.Globalization;
@ -44,7 +45,8 @@ namespace Avalonia.Controls
/// </summary>
public static readonly DirectProperty<TimePicker, TimeSpan?> SelectedTimeProperty =
AvaloniaProperty.RegisterDirect<TimePicker, TimeSpan?>(nameof(SelectedTime),
x => x.SelectedTime, (x, v) => x.SelectedTime = v);
x => x.SelectedTime, (x, v) => x.SelectedTime = v,
defaultBindingMode: BindingMode.TwoWay);
// Template Items
private TimePickerPresenter _presenter;

Loading…
Cancel
Save