mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
UWP sample application
This commit is contained in:
parent
70bc9b89ac
commit
b559f8e94b
|
|
@ -84,8 +84,40 @@
|
|||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="map:MapItem">
|
||||
<map:Pushpin Content="{Binding Name}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"/>
|
||||
<Grid>
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal"/>
|
||||
<VisualState x:Name="Disabled"/>
|
||||
<VisualState x:Name="PointerOver"/>
|
||||
<VisualState x:Name="Pressed"/>
|
||||
<VisualState x:Name="Selected">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="pushpin.Foreground" Value="OrangeRed"/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="SelectedUnfocused">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="pushpin.Foreground" Value="OrangeRed"/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="SelectedPointerOver">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="pushpin.Foreground" Value="OrangeRed"/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="SelectedPressed">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="pushpin.Foreground" Value="OrangeRed"/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
|
||||
<map:Pushpin x:Name="pushpin" Content="{Binding Name}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"/>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
|
@ -113,12 +145,15 @@
|
|||
|
||||
<map:MapItemsControl ItemsSource="{Binding Points}"
|
||||
ItemContainerStyle="{StaticResource PointItemStyle}"
|
||||
LocationMemberPath="Location"
|
||||
SelectionMode="Extended"/>
|
||||
SelectionMode="Multiple"
|
||||
LocationMemberPath="Location"/>
|
||||
|
||||
<map:MapItemsControl ItemsSource="{Binding Pushpins}"
|
||||
ItemContainerStyle="{StaticResource PushpinItemStyle}"
|
||||
LocationMemberPath="Location"/>
|
||||
SelectedItem="{Binding SelectedPushpin, Mode=TwoWay}"
|
||||
SelectionMode="Multiple"
|
||||
LocationMemberPath="Location"
|
||||
SelectionChanged="MapItemsControlSelectionChanged"/>
|
||||
|
||||
<map:Pushpin Location="53.5,8.2" AutoCollapse="True" Content="N 53°30' E 8°12'"/>
|
||||
</map:Map>
|
||||
|
|
|
|||
|
|
@ -80,6 +80,11 @@ namespace SampleApplication
|
|||
|
||||
partial void AddTestLayers();
|
||||
|
||||
private void MapItemsControlSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
Debug.WriteLine("SelectedItems: " + string.Join(", ", ((MapItemsControl)sender).SelectedItems.OfType<PointItem>().Select(item => item.Name)));
|
||||
}
|
||||
|
||||
private void ResetHeadingButtonClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
map.TargetHeading = 0d;
|
||||
|
|
|
|||
|
|
@ -137,12 +137,6 @@
|
|||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<!--<Style.Triggers>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter Property="Panel.ZIndex" Value="1"/>
|
||||
<Setter Property="Foreground" Value="OrangeRed"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>-->
|
||||
</Style>
|
||||
</Grid.Resources>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue