From b8ad5a6dd152e4e80ef622d5c6fd0ed91bc2b607 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Wed, 28 Oct 2020 19:47:20 +0000 Subject: [PATCH 01/11] change template for datavalidation errors. --- .../DataValidationErrors.xaml | 48 ++++++++----------- 1 file changed, 20 insertions(+), 28 deletions(-) diff --git a/src/Avalonia.Themes.Fluent/DataValidationErrors.xaml b/src/Avalonia.Themes.Fluent/DataValidationErrors.xaml index 902fc74c0c..1161a92e30 100644 --- a/src/Avalonia.Themes.Fluent/DataValidationErrors.xaml +++ b/src/Avalonia.Themes.Fluent/DataValidationErrors.xaml @@ -14,39 +14,31 @@ - - + + - - - - - - - - - - + + + + + + + From 9e0b33b542b2c33bdb3526bef5c7f988d43a6e07 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Wed, 28 Oct 2020 20:40:52 +0000 Subject: [PATCH 02/11] add an example of datavalidation errors on textbox. --- samples/ControlCatalog/Pages/TextBoxPage.xaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/samples/ControlCatalog/Pages/TextBoxPage.xaml b/samples/ControlCatalog/Pages/TextBoxPage.xaml index 8b07ac3f85..4958174f40 100644 --- a/samples/ControlCatalog/Pages/TextBoxPage.xaml +++ b/samples/ControlCatalog/Pages/TextBoxPage.xaml @@ -1,6 +1,7 @@ + x:Class="ControlCatalog.Pages.TextBoxPage" + xmlns:sys="clr-namespace:System;assembly=netstandard"> @@ -11,12 +12,18 @@ Spacing="16"> - + + + + + + + Date: Wed, 28 Oct 2020 20:41:14 +0000 Subject: [PATCH 03/11] position datavalidation errors underneath textbox. --- src/Avalonia.Themes.Fluent/TextBox.xaml | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/Avalonia.Themes.Fluent/TextBox.xaml b/src/Avalonia.Themes.Fluent/TextBox.xaml index 162835ae10..2303c438fc 100644 --- a/src/Avalonia.Themes.Fluent/TextBox.xaml +++ b/src/Avalonia.Themes.Fluent/TextBox.xaml @@ -37,15 +37,8 @@ - - - - + + - - - + - From cc712b6e0f8e3eab9e275f036a838fdf6dab6715 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Wed, 28 Oct 2020 20:49:30 +0000 Subject: [PATCH 04/11] wrap control in datavalidation errors so it can be applied consistently. --- src/Avalonia.Themes.Fluent/DataValidationErrors.xaml | 2 +- src/Avalonia.Themes.Fluent/TextBox.xaml | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Avalonia.Themes.Fluent/DataValidationErrors.xaml b/src/Avalonia.Themes.Fluent/DataValidationErrors.xaml index 1161a92e30..ed31f7b573 100644 --- a/src/Avalonia.Themes.Fluent/DataValidationErrors.xaml +++ b/src/Avalonia.Themes.Fluent/DataValidationErrors.xaml @@ -14,7 +14,7 @@ - - - - + - + From 76d3d013e34e0a1d9cd91daf0a319910f77f60c5 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Wed, 28 Oct 2020 21:36:35 +0000 Subject: [PATCH 05/11] add datavalidations to button spinner. --- .../Pages/ButtonSpinnerPage.xaml | 11 ++- src/Avalonia.Themes.Fluent/ButtonSpinner.xaml | 99 ++++++++++--------- 2 files changed, 61 insertions(+), 49 deletions(-) diff --git a/samples/ControlCatalog/Pages/ButtonSpinnerPage.xaml b/samples/ControlCatalog/Pages/ButtonSpinnerPage.xaml index c3f9f65dd9..4ac2330403 100644 --- a/samples/ControlCatalog/Pages/ButtonSpinnerPage.xaml +++ b/samples/ControlCatalog/Pages/ButtonSpinnerPage.xaml @@ -1,6 +1,7 @@  + x:Class="ControlCatalog.Pages.ButtonSpinnerPage" + xmlns:sys="clr-namespace:System;assembly=netstandard"> ButtonSpinner @@ -19,6 +20,14 @@ ShowButtonSpinner="{Binding #showSpinCheck.IsChecked}"> + + + + + + diff --git a/src/Avalonia.Themes.Fluent/ButtonSpinner.xaml b/src/Avalonia.Themes.Fluent/ButtonSpinner.xaml index 82265ea282..12b4845522 100644 --- a/src/Avalonia.Themes.Fluent/ButtonSpinner.xaml +++ b/src/Avalonia.Themes.Fluent/ButtonSpinner.xaml @@ -65,56 +65,59 @@ - - - + + + + - - - - + + + + - - - - - - + + + + + + + From 62ca81e9fbfbba9a3436553d4a4d8bb4f108b98b Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Wed, 28 Oct 2020 21:49:41 +0000 Subject: [PATCH 06/11] add datavalidation errors to combobox. --- .../ControlCatalog/Pages/ComboBoxPage.xaml | 13 +- src/Avalonia.Controls/Primitives/Popup.cs | 1 + src/Avalonia.Themes.Fluent/ComboBox.xaml | 201 +++++++++--------- 3 files changed, 117 insertions(+), 98 deletions(-) diff --git a/samples/ControlCatalog/Pages/ComboBoxPage.xaml b/samples/ControlCatalog/Pages/ComboBoxPage.xaml index 369f703718..025b85492c 100644 --- a/samples/ControlCatalog/Pages/ComboBoxPage.xaml +++ b/samples/ControlCatalog/Pages/ComboBoxPage.xaml @@ -1,6 +1,7 @@ + x:Class="ControlCatalog.Pages.ComboBoxPage" + xmlns:sys="clr-namespace:System;assembly=netstandard"> ComboBox A drop-down list. @@ -35,6 +36,16 @@ + + + Inline Items + Inline Item 2 + Inline Item 3 + Inline Item 4 + + + + diff --git a/src/Avalonia.Controls/Primitives/Popup.cs b/src/Avalonia.Controls/Primitives/Popup.cs index becb489557..b445de0472 100644 --- a/src/Avalonia.Controls/Primitives/Popup.cs +++ b/src/Avalonia.Controls/Primitives/Popup.cs @@ -265,6 +265,7 @@ namespace Avalonia.Controls.Primitives /// /// Gets or sets the control that is used to determine the popup's position. /// + [ResolveByName] public Control? PlacementTarget { get { return GetValue(PlacementTargetProperty); } diff --git a/src/Avalonia.Themes.Fluent/ComboBox.xaml b/src/Avalonia.Themes.Fluent/ComboBox.xaml index 8155264f18..2eee656dc6 100644 --- a/src/Avalonia.Themes.Fluent/ComboBox.xaml +++ b/src/Avalonia.Themes.Fluent/ComboBox.xaml @@ -44,105 +44,107 @@ - - + + + + + + + - - - - + + + + - - - - - - - - - - - - - - - - - - + Grid.Column="1" + IsHitTestVisible="False" + Margin="0,0,10,0" + Height="12" + Width="12" + HorizontalAlignment="Right" + VerticalAlignment="Center"> + + + + + + + + + + + + + + @@ -232,4 +234,9 @@ + + + From 18ac4010070cfb1e77502fb34840da45bce67958 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Wed, 28 Oct 2020 21:56:12 +0000 Subject: [PATCH 07/11] add example of datavalidation on autocomplete box. --- samples/ControlCatalog/Pages/AutoCompleteBoxPage.xaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/samples/ControlCatalog/Pages/AutoCompleteBoxPage.xaml b/samples/ControlCatalog/Pages/AutoCompleteBoxPage.xaml index a49616e543..1a53217842 100644 --- a/samples/ControlCatalog/Pages/AutoCompleteBoxPage.xaml +++ b/samples/ControlCatalog/Pages/AutoCompleteBoxPage.xaml @@ -1,5 +1,6 @@ AutoCompleteBox @@ -56,6 +57,16 @@ Width="200" Margin="0,0,0,8" FilterMode="None"/> + + + + + + + From a0ce794c41a15aa336e36d96af45361b9ebc27dc Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Wed, 28 Oct 2020 22:02:49 +0000 Subject: [PATCH 08/11] make numeric up down work with validation errors. --- samples/ControlCatalog/Pages/NumericUpDownPage.xaml | 10 ++++++++++ src/Avalonia.Themes.Fluent/NumericUpDown.xaml | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/samples/ControlCatalog/Pages/NumericUpDownPage.xaml b/samples/ControlCatalog/Pages/NumericUpDownPage.xaml index 0d7e5da17f..d75622f1fb 100644 --- a/samples/ControlCatalog/Pages/NumericUpDownPage.xaml +++ b/samples/ControlCatalog/Pages/NumericUpDownPage.xaml @@ -1,5 +1,6 @@  Numeric up-down control @@ -75,6 +76,15 @@ + + NumericUpDown with Validation Errors: + + + + + diff --git a/src/Avalonia.Themes.Fluent/NumericUpDown.xaml b/src/Avalonia.Themes.Fluent/NumericUpDown.xaml index cc5e2234f8..1da48ebd8a 100644 --- a/src/Avalonia.Themes.Fluent/NumericUpDown.xaml +++ b/src/Avalonia.Themes.Fluent/NumericUpDown.xaml @@ -39,6 +39,7 @@ VerticalContentAlignment="Stretch" AllowSpin="{TemplateBinding AllowSpin}" ShowButtonSpinner="{TemplateBinding ShowButtonSpinner}" + DataValidationErrors.Errors="{TemplateBinding (DataValidationErrors.Errors)}" ButtonSpinnerLocation="{TemplateBinding ButtonSpinnerLocation}"> Date: Wed, 28 Oct 2020 22:22:43 +0000 Subject: [PATCH 09/11] add datavalidation to date and time pickers. --- .../Pages/DateTimePickerPage.xaml | 20 +++ src/Avalonia.Themes.Fluent/DatePicker.xaml | 143 +++++++-------- src/Avalonia.Themes.Fluent/TimePicker.xaml | 164 +++++++++--------- 3 files changed, 180 insertions(+), 147 deletions(-) diff --git a/samples/ControlCatalog/Pages/DateTimePickerPage.xaml b/samples/ControlCatalog/Pages/DateTimePickerPage.xaml index af6b6e8605..45056a9a76 100644 --- a/samples/ControlCatalog/Pages/DateTimePickerPage.xaml +++ b/samples/ControlCatalog/Pages/DateTimePickerPage.xaml @@ -2,6 +2,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:sys="clr-namespace:System;assembly=netstandard" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="ControlCatalog.Pages.DateTimePickerPage"> @@ -30,6 +31,16 @@ + + + + + + + + + A DatePicker with day formatted and year hidden. + + + + + + + + A TimePicker with a header and minute increments specified. diff --git a/src/Avalonia.Themes.Fluent/DatePicker.xaml b/src/Avalonia.Themes.Fluent/DatePicker.xaml index 6fbfa1bbf7..b6e36861e0 100644 --- a/src/Avalonia.Themes.Fluent/DatePicker.xaml +++ b/src/Avalonia.Themes.Fluent/DatePicker.xaml @@ -125,77 +125,79 @@ - - + + + - + - - - + + + - + + @@ -228,6 +230,11 @@ + + + @@ -161,6 +163,10 @@ + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + @@ -102,56 +104,58 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + @@ -260,4 +264,8 @@ + + From 233fdc9289cb6125f18c8566e157c711224eb576 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Thu, 29 Oct 2020 11:30:18 +0000 Subject: [PATCH 11/11] make slider track red when there is an error. --- src/Avalonia.Themes.Fluent/Slider.xaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Avalonia.Themes.Fluent/Slider.xaml b/src/Avalonia.Themes.Fluent/Slider.xaml index 8abba461e7..d70eb1abe3 100644 --- a/src/Avalonia.Themes.Fluent/Slider.xaml +++ b/src/Avalonia.Themes.Fluent/Slider.xaml @@ -268,4 +268,8 @@ + +