mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
63 lines
3.5 KiB
XML
63 lines
3.5 KiB
XML
<ResourceDictionary
|
|
xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:map="clr-namespace:MapControl">
|
|
|
|
<ControlTemplate TargetType="ContentControl" x:Key="ContentControlTemplate">
|
|
<ContentPresenter
|
|
Content="{TemplateBinding Content}"
|
|
ContentTemplate="{TemplateBinding ContentTemplate}"
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
|
Margin="{TemplateBinding Padding}"/>
|
|
</ControlTemplate>
|
|
|
|
<ControlTheme TargetType="ContentControl" x:Key="ContentControlTheme">
|
|
<Setter Property="Background" Value="{CompiledBinding Background, RelativeSource={RelativeSource AncestorType=map:MapBase}}"/>
|
|
<Setter Property="BorderBrush" Value="{CompiledBinding Foreground, RelativeSource={RelativeSource AncestorType=map:MapBase}}"/>
|
|
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
|
<Setter Property="VerticalAlignment" Value="Stretch"/>
|
|
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
|
<Setter Property="VerticalContentAlignment" Value="Stretch"/>
|
|
<Setter Property="ClipToBounds" Value="False"/>
|
|
|
|
<!-- Template Setter here does somehow break a Style for a derived type like MapItem -->
|
|
<!--<Setter Property="Template" Value="{StaticResource ContentControlTemplate}"/>-->
|
|
</ControlTheme>
|
|
|
|
<ControlTheme TargetType="map:MapContentControl" x:Key="{x:Type map:MapContentControl}" BasedOn="{StaticResource ContentControlTheme}">
|
|
<Setter Property="Template" Value="{StaticResource ContentControlTemplate}"/>
|
|
</ControlTheme>
|
|
|
|
<ControlTheme TargetType="map:MapItem" x:Key="{x:Type map:MapItem}" BasedOn="{StaticResource ContentControlTheme}">
|
|
<Setter Property="Template" Value="{StaticResource ContentControlTemplate}"/>
|
|
</ControlTheme>
|
|
|
|
<ControlTheme TargetType="map:Pushpin" x:Key="{x:Type map:Pushpin}" BasedOn="{StaticResource ContentControlTheme}">
|
|
<Setter Property="HorizontalAlignment" Value="Center"/>
|
|
<Setter Property="VerticalAlignment" Value="Bottom"/>
|
|
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
|
<Setter Property="BorderThickness" Value="1"/>
|
|
<Setter Property="CornerRadius" Value="0"/>
|
|
<Setter Property="Padding" Value="6,4"/>
|
|
<Setter Property="Template">
|
|
<ControlTemplate TargetType="map:Pushpin">
|
|
<map:PushpinBorder
|
|
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
|
Background="{TemplateBinding Background}"
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
BorderWidth="{Binding BorderThickness.Left, RelativeSource={RelativeSource TemplatedParent}}"
|
|
CornerRadius="{TemplateBinding CornerRadius}"
|
|
Padding="{TemplateBinding Padding}">
|
|
<ContentPresenter
|
|
Content="{TemplateBinding Content}"
|
|
ContentTemplate="{TemplateBinding ContentTemplate}"
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
|
</map:PushpinBorder>
|
|
</ControlTemplate>
|
|
</Setter>
|
|
</ControlTheme>
|
|
</ResourceDictionary>
|