From d1efb9f3430dfc7d525a3ecc90c938fe4c713810 Mon Sep 17 00:00:00 2001 From: ClemensFischer Date: Tue, 3 Sep 2024 12:11:04 +0200 Subject: [PATCH] FlowDirection must be LeftToRight --- MapControl/Avalonia/MapBase.Avalonia.cs | 7 ++++++- MapControl/Avalonia/Themes/Generic.axaml | 7 ------- MapControl/WPF/MapBase.WPF.cs | 3 ++- MapControl/WPF/Themes/Generic.xaml | 5 ----- MapControl/WinUI/MapBase.WinUI.cs | 4 +++- 5 files changed, 11 insertions(+), 15 deletions(-) diff --git a/MapControl/Avalonia/MapBase.Avalonia.cs b/MapControl/Avalonia/MapBase.Avalonia.cs index 31cd6b33..a0555e70 100644 --- a/MapControl/Avalonia/MapBase.Avalonia.cs +++ b/MapControl/Avalonia/MapBase.Avalonia.cs @@ -35,7 +35,7 @@ namespace MapControl public partial class MapBase { public static readonly StyledProperty ForegroundProperty = - DependencyPropertyHelper.AddOwner(TextElement.ForegroundProperty); + DependencyPropertyHelper.AddOwner(TextElement.ForegroundProperty, Brushes.Black); public static readonly StyledProperty AnimationEasingProperty = DependencyPropertyHelper.Register(nameof(AnimationEasing), new QuadraticEaseOut()); @@ -104,6 +104,11 @@ namespace MapControl Animation.RegisterCustomAnimator(); } + public MapBase() + { + FlowDirection = FlowDirection.LeftToRight; // OverrideDefaultValue won't stop value inheritance + } + public double ActualWidth => Bounds.Width; public double ActualHeight => Bounds.Height; diff --git a/MapControl/Avalonia/Themes/Generic.axaml b/MapControl/Avalonia/Themes/Generic.axaml index 7001d103..caecb9b0 100644 --- a/MapControl/Avalonia/Themes/Generic.axaml +++ b/MapControl/Avalonia/Themes/Generic.axaml @@ -3,13 +3,6 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:map="clr-namespace:MapControl"> - - - - - - - (TextElement.ForegroundProperty); + DependencyPropertyHelper.AddOwner(TextElement.ForegroundProperty, Brushes.Black); public static readonly DependencyProperty AnimationEasingFunctionProperty = DependencyPropertyHelper.Register(nameof(AnimationEasingFunction), @@ -78,6 +78,7 @@ namespace MapControl BackgroundProperty.OverrideMetadata(typeof(MapBase), new FrameworkPropertyMetadata(Brushes.White)); ClipToBoundsProperty.OverrideMetadata(typeof(MapBase), new FrameworkPropertyMetadata(true)); DefaultStyleKeyProperty.OverrideMetadata(typeof(MapBase), new FrameworkPropertyMetadata(typeof(MapBase))); + FlowDirectionProperty.OverrideMetadata(typeof(MapBase), new FrameworkPropertyMetadata(FlowDirection.LeftToRight) { Inherits = false }); } /// diff --git a/MapControl/WPF/Themes/Generic.xaml b/MapControl/WPF/Themes/Generic.xaml index bd8eca18..d7cb6d22 100644 --- a/MapControl/WPF/Themes/Generic.xaml +++ b/MapControl/WPF/Themes/Generic.xaml @@ -3,11 +3,6 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:map="clr-namespace:MapControl"> - -