mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-04 14:08:32 +00:00
Avalonia ControlThemes
This commit is contained in:
parent
a02abb7f76
commit
4608f9a511
7 changed files with 122 additions and 47 deletions
|
|
@ -2,8 +2,14 @@
|
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:Class="SampleApplication.App"
|
||||
RequestedThemeVariant="Light">
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceInclude Source="avares://MapControl.Avalonia/Themes/Generic.axaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
<Application.Styles>
|
||||
<FluentTheme />
|
||||
<StyleInclude Source="avares://MapControl.Avalonia/Themes/Generic.axaml"/>
|
||||
</Application.Styles>
|
||||
</Application>
|
||||
|
|
|
|||
|
|
@ -16,6 +16,38 @@
|
|||
ManipulationModes="All"
|
||||
DoubleTapped="MapDoubleTapped">
|
||||
|
||||
<map:MapItemsControl ItemsSource="{Binding Polylines}">
|
||||
<map:MapItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<map:MapPolyline Locations="{Binding Locations}" Stroke="Red" StrokeThickness="3"/>
|
||||
</DataTemplate>
|
||||
</map:MapItemsControl.ItemTemplate>
|
||||
</map:MapItemsControl>
|
||||
|
||||
<map:MapItemsControl ItemsSource="{Binding Points}"
|
||||
SelectionMode="Multiple">
|
||||
<map:MapItemsControl.Styles>
|
||||
<Style Selector="map|MapItem">
|
||||
<Setter Property="map:MapPanel.Location" Value="{Binding Location}"/>
|
||||
</Style>
|
||||
<Style Selector="map|MapItem:selected">
|
||||
<Setter Property="Foreground" Value="OrangeRed"/>
|
||||
</Style>
|
||||
</map:MapItemsControl.Styles>
|
||||
<map:MapItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Canvas Width="100" Height="100" ClipToBounds="False">
|
||||
<Path StrokeThickness="2" Stroke="Gray" Fill="Transparent">
|
||||
<Path.Data>
|
||||
<EllipseGeometry RadiusX="8" RadiusY="8"/>
|
||||
</Path.Data>
|
||||
</Path>
|
||||
<TextBlock Margin="16,-9,0,0" Text="{Binding Name}"/>
|
||||
</Canvas>
|
||||
</DataTemplate>
|
||||
</map:MapItemsControl.ItemTemplate>
|
||||
</map:MapItemsControl>
|
||||
|
||||
<map:MapItemsControl ItemsSource="{Binding Pushpins}"
|
||||
SelectedItem="{Binding SelectedPushpin}"
|
||||
SelectionMode="Multiple"
|
||||
|
|
@ -28,8 +60,9 @@
|
|||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Bottom"/>
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<map:Pushpin Content="{Binding Name}"/>
|
||||
<ControlTemplate TargetType="map:MapItem">
|
||||
<map:Pushpin Content="{Binding Name}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"/>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ namespace SampleApplication
|
|||
Points.Add(new PointItem
|
||||
{
|
||||
Name = "Buhne 10",
|
||||
Location = new Location(53.49350, 8.15563)
|
||||
Location = new Location(53.49348, 8.15694)
|
||||
});
|
||||
|
||||
Pushpins.Add(new PointItem
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue