mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-20 22:05:07 +00:00
FlowDirection must be LeftToRight
This commit is contained in:
parent
bfb5a978ee
commit
d1efb9f343
5 changed files with 11 additions and 15 deletions
|
|
@ -35,7 +35,7 @@ namespace MapControl
|
||||||
public partial class MapBase
|
public partial class MapBase
|
||||||
{
|
{
|
||||||
public static readonly StyledProperty<Brush> ForegroundProperty =
|
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 =
|
public static readonly StyledProperty<Easing> AnimationEasingProperty =
|
||||||
DependencyPropertyHelper.Register<MapBase, Easing>(nameof(AnimationEasing), new QuadraticEaseOut());
|
DependencyPropertyHelper.Register<MapBase, Easing>(nameof(AnimationEasing), new QuadraticEaseOut());
|
||||||
|
|
@ -104,6 +104,11 @@ namespace MapControl
|
||||||
Animation.RegisterCustomAnimator<Location, LocationAnimator>();
|
Animation.RegisterCustomAnimator<Location, LocationAnimator>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MapBase()
|
||||||
|
{
|
||||||
|
FlowDirection = FlowDirection.LeftToRight; // OverrideDefaultValue won't stop value inheritance
|
||||||
|
}
|
||||||
|
|
||||||
public double ActualWidth => Bounds.Width;
|
public double ActualWidth => Bounds.Width;
|
||||||
public double ActualHeight => Bounds.Height;
|
public double ActualHeight => Bounds.Height;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,6 @@
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:map="clr-namespace:MapControl">
|
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">
|
<ControlTemplate TargetType="ContentControl" x:Key="ContentControlTemplate">
|
||||||
<ContentPresenter
|
<ContentPresenter
|
||||||
Content="{TemplateBinding Content}"
|
Content="{TemplateBinding Content}"
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ namespace MapControl
|
||||||
public partial class MapBase
|
public partial class MapBase
|
||||||
{
|
{
|
||||||
public static readonly DependencyProperty ForegroundProperty =
|
public static readonly DependencyProperty ForegroundProperty =
|
||||||
DependencyPropertyHelper.AddOwner<MapBase, Brush>(TextElement.ForegroundProperty);
|
DependencyPropertyHelper.AddOwner<MapBase, Brush>(TextElement.ForegroundProperty, Brushes.Black);
|
||||||
|
|
||||||
public static readonly DependencyProperty AnimationEasingFunctionProperty =
|
public static readonly DependencyProperty AnimationEasingFunctionProperty =
|
||||||
DependencyPropertyHelper.Register<MapBase, IEasingFunction>(nameof(AnimationEasingFunction),
|
DependencyPropertyHelper.Register<MapBase, IEasingFunction>(nameof(AnimationEasingFunction),
|
||||||
|
|
@ -78,6 +78,7 @@ namespace MapControl
|
||||||
BackgroundProperty.OverrideMetadata(typeof(MapBase), new FrameworkPropertyMetadata(Brushes.White));
|
BackgroundProperty.OverrideMetadata(typeof(MapBase), new FrameworkPropertyMetadata(Brushes.White));
|
||||||
ClipToBoundsProperty.OverrideMetadata(typeof(MapBase), new FrameworkPropertyMetadata(true));
|
ClipToBoundsProperty.OverrideMetadata(typeof(MapBase), new FrameworkPropertyMetadata(true));
|
||||||
DefaultStyleKeyProperty.OverrideMetadata(typeof(MapBase), new FrameworkPropertyMetadata(typeof(MapBase)));
|
DefaultStyleKeyProperty.OverrideMetadata(typeof(MapBase), new FrameworkPropertyMetadata(typeof(MapBase)));
|
||||||
|
FlowDirectionProperty.OverrideMetadata(typeof(MapBase), new FrameworkPropertyMetadata(FlowDirection.LeftToRight) { Inherits = false });
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,6 @@
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:map="clr-namespace:MapControl">
|
xmlns:map="clr-namespace:MapControl">
|
||||||
|
|
||||||
<Style TargetType="map:MapBase">
|
|
||||||
<Setter Property="FlowDirection" Value="LeftToRight"/>
|
|
||||||
<Setter Property="Foreground" Value="Black"/>
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<Style TargetType="map:MapItemsControl">
|
<Style TargetType="map:MapItemsControl">
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
|
|
|
||||||
|
|
@ -79,9 +79,11 @@ namespace MapControl
|
||||||
//
|
//
|
||||||
var style = new Style(typeof(MapBase));
|
var style = new Style(typeof(MapBase));
|
||||||
style.Setters.Add(new Setter(BackgroundProperty, new SolidColorBrush(Colors.White)));
|
style.Setters.Add(new Setter(BackgroundProperty, new SolidColorBrush(Colors.White)));
|
||||||
style.Setters.Add(new Setter(FlowDirectionProperty, FlowDirection.LeftToRight));
|
style.Seal();
|
||||||
Style = style;
|
Style = style;
|
||||||
|
|
||||||
|
FlowDirection = FlowDirection.LeftToRight;
|
||||||
|
|
||||||
SizeChanged += OnSizeChanged;
|
SizeChanged += OnSizeChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue