Browse Source
Merge pull request #6022 from Deadpikle/feature/date-time-picker-twoway
SelectedDate and SelectedTime => TwoWay by default
pull/6032/head
Dariusz Komosiński
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
6 additions and
2 deletions
-
src/Avalonia.Controls/DateTimePickers/DatePicker.cs
-
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 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; |
|
|
|
|
|
|
|
@ -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; |
|
|
|
|