From 4007dfa0b9ce8d374e58551a0494e2bc29d6ecb3 Mon Sep 17 00:00:00 2001 From: Tim <47110241+timunie@users.noreply.github.com> Date: Mon, 13 Nov 2023 16:46:58 +0100 Subject: [PATCH] Fix: Allow ColorPicker-Fylout to swap position if needed (#13567) * Add `PlacementConstraintAdjustmentProperty` to PopupFlyoutBase This adds much more flexibility to control flyout positioning when there is not enough space to show the Flyout. * Make Fylout position of the ColorPicker a DynamicResource This allows the position to be overridden easily. It should no longer be hard coded. * Address review --- .../Themes/Fluent/ColorPicker.xaml | 6 ++++-- .../Themes/Simple/ColorPicker.xaml | 7 +++++-- .../Flyouts/PopupFlyoutBase.cs | 17 ++++++++++++++--- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorPicker.xaml b/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorPicker.xaml index f051d9bbab..b74e4e59aa 100644 --- a/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorPicker.xaml +++ b/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorPicker.xaml @@ -1,9 +1,11 @@ - + Top + @@ -51,7 +53,7 @@ + Placement="{DynamicResource ColorPickerFlyoutPlacement}">