FlowDirection must be LeftToRight

This commit is contained in:
ClemensFischer 2024-09-03 12:11:04 +02:00
parent bfb5a978ee
commit d1efb9f343
5 changed files with 11 additions and 15 deletions

View file

@ -35,7 +35,7 @@ namespace MapControl
public partial class MapBase
{
public static readonly StyledProperty<Brush> ForegroundProperty =
DependencyPropertyHelper.AddOwner<MapBase, Brush>(TextElement.ForegroundProperty);
DependencyPropertyHelper.AddOwner<MapBase, Brush>(TextElement.ForegroundProperty, Brushes.Black);
public static readonly StyledProperty<Easing> AnimationEasingProperty =
DependencyPropertyHelper.Register<MapBase, Easing>(nameof(AnimationEasing), new QuadraticEaseOut());
@ -104,6 +104,11 @@ namespace MapControl
Animation.RegisterCustomAnimator<Location, LocationAnimator>();
}
public MapBase()
{
FlowDirection = FlowDirection.LeftToRight; // OverrideDefaultValue won't stop value inheritance
}
public double ActualWidth => Bounds.Width;
public double ActualHeight => Bounds.Height;

View file

@ -3,13 +3,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:map="clr-namespace:MapControl">
<ControlTheme TargetType="map:MapBase" x:Key="{x:Type map:MapBase}">
<Setter Property="FlowDirection" Value="LeftToRight"/>
<Setter Property="Foreground" Value="Black"/>
</ControlTheme>
<ControlTheme TargetType="map:Map" x:Key="{x:Type map:Map}" BasedOn="{StaticResource {x:Type map:MapBase}}"/>
<ControlTemplate TargetType="ContentControl" x:Key="ContentControlTemplate">
<ContentPresenter
Content="{TemplateBinding Content}"