mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-01-07 01:00:43 +01:00
Version 2.4.11: Fixed MapPolyline.Locations property on Windows Phone. Removed Panel.ZIndex handling from MapItemsControl.WPF.
This commit is contained in:
parent
03094ff66f
commit
575930dce8
|
|
@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyCompany("Clemens Fischer")]
|
||||
[assembly: AssemblyCopyright("© 2015 Clemens Fischer")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyVersion("2.4.10")]
|
||||
[assembly: AssemblyFileVersion("2.4.10")]
|
||||
[assembly: AssemblyVersion("2.4.11")]
|
||||
[assembly: AssemblyFileVersion("2.4.11")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyCompany("Clemens Fischer")]
|
||||
[assembly: AssemblyCopyright("© 2015 Clemens Fischer")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyVersion("2.4.10")]
|
||||
[assembly: AssemblyFileVersion("2.4.10")]
|
||||
[assembly: AssemblyVersion("2.4.11")]
|
||||
[assembly: AssemblyFileVersion("2.4.11")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyCompany("Clemens Fischer")]
|
||||
[assembly: AssemblyCopyright("© 2015 Clemens Fischer")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyVersion("2.4.10")]
|
||||
[assembly: AssemblyFileVersion("2.4.10")]
|
||||
[assembly: AssemblyVersion("2.4.11")]
|
||||
[assembly: AssemblyFileVersion("2.4.11")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyCompany("Clemens Fischer")]
|
||||
[assembly: AssemblyCopyright("© 2015 Clemens Fischer")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyVersion("2.4.10")]
|
||||
[assembly: AssemblyFileVersion("2.4.10")]
|
||||
[assembly: AssemblyVersion("2.4.11")]
|
||||
[assembly: AssemblyFileVersion("2.4.11")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ namespace MapControl
|
|||
public static Location Parse(string s)
|
||||
{
|
||||
var pair = s.Split(new char[] { ',' });
|
||||
|
||||
if (pair.Length != 2)
|
||||
{
|
||||
throw new FormatException("Location string must be a comma-separated pair of double values");
|
||||
|
|
|
|||
|
|
@ -2,8 +2,6 @@
|
|||
// © 2015 Clemens Fischer
|
||||
// Licensed under the Microsoft Public License (Ms-PL)
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
|
|
@ -20,12 +18,6 @@ namespace MapControl
|
|||
typeof(MapItemsControl), new FrameworkPropertyMetadata(typeof(MapItemsControl)));
|
||||
}
|
||||
|
||||
public MapItemsControl()
|
||||
{
|
||||
Items.CurrentChanging += CurrentItemChanging;
|
||||
Items.CurrentChanged += CurrentItemChanged;
|
||||
}
|
||||
|
||||
protected override DependencyObject GetContainerForItemOverride()
|
||||
{
|
||||
return new MapItem();
|
||||
|
|
@ -35,27 +27,5 @@ namespace MapControl
|
|||
{
|
||||
return item is MapItem;
|
||||
}
|
||||
|
||||
private void CurrentItemChanging(object sender, CurrentChangingEventArgs e)
|
||||
{
|
||||
var container = ItemContainerGenerator.ContainerFromItem(Items.CurrentItem) as UIElement;
|
||||
|
||||
if (container != null)
|
||||
{
|
||||
var zIndex = Panel.GetZIndex(container);
|
||||
Panel.SetZIndex(container, zIndex & ~0x40000000);
|
||||
}
|
||||
}
|
||||
|
||||
private void CurrentItemChanged(object sender, EventArgs e)
|
||||
{
|
||||
var container = ItemContainerGenerator.ContainerFromItem(Items.CurrentItem) as UIElement;
|
||||
|
||||
if (container != null)
|
||||
{
|
||||
var zIndex = Panel.GetZIndex(container);
|
||||
Panel.SetZIndex(container, zIndex | 0x40000000);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,9 +15,9 @@ using System.Windows.Media;
|
|||
namespace MapControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Positions child elements on a Map, at a position specified by the attached property Location.
|
||||
/// The Location is transformed to a viewport position by ParentMap.MapTransform and ParentMap.ViewportTransform
|
||||
/// and applied to a child element's RenderTransform as an appropriate TranslateTransform.
|
||||
/// Arranges child elements on a Map at positions specified by the attached property Location,
|
||||
/// which is transformed to a viewport position by ParentMap.MapTransform and ParentMap.ViewportTransform
|
||||
/// and assigned to the child element's RenderTransform as a TranslateTransform.
|
||||
/// </summary>
|
||||
public partial class MapPanel : PanelBase, IMapElement
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
#if WINDOWS_RUNTIME
|
||||
using System.Collections;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Media;
|
||||
#else
|
||||
|
|
@ -20,10 +21,16 @@ namespace MapControl
|
|||
/// </summary>
|
||||
public partial class MapPolyline : MapPath
|
||||
{
|
||||
#if WINDOWS_RUNTIME
|
||||
// Binding fails on Windows Phone when property type is IEnumerable<Location>
|
||||
public static readonly DependencyProperty LocationsProperty = DependencyProperty.Register(
|
||||
"Locations", typeof(IEnumerable), typeof(MapPolyline),
|
||||
new PropertyMetadata(null, LocationsPropertyChanged));
|
||||
#else
|
||||
public static readonly DependencyProperty LocationsProperty = DependencyProperty.Register(
|
||||
"Locations", typeof(IEnumerable<Location>), typeof(MapPolyline),
|
||||
new PropertyMetadata(null, LocationsPropertyChanged));
|
||||
|
||||
#endif
|
||||
public static readonly DependencyProperty IsClosedProperty = DependencyProperty.Register(
|
||||
"IsClosed", typeof(bool), typeof(MapPolyline),
|
||||
new PropertyMetadata(false, (o, e) => ((MapPolyline)o).UpdateData()));
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ using System.Windows;
|
|||
[assembly: AssemblyCompany("Clemens Fischer")]
|
||||
[assembly: AssemblyCopyright("© 2015 Clemens Fischer")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyVersion("2.4.10")]
|
||||
[assembly: AssemblyFileVersion("2.4.10")]
|
||||
[assembly: AssemblyVersion("2.4.11")]
|
||||
[assembly: AssemblyFileVersion("2.4.11")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyCompany("Clemens Fischer")]
|
||||
[assembly: AssemblyCopyright("© 2015 Clemens Fischer")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyVersion("2.4.10")]
|
||||
[assembly: AssemblyFileVersion("2.4.10")]
|
||||
[assembly: AssemblyVersion("2.4.11")]
|
||||
[assembly: AssemblyFileVersion("2.4.11")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyCompany("Clemens Fischer")]
|
||||
[assembly: AssemblyCopyright("© 2015 Clemens Fischer")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyVersion("2.4.10")]
|
||||
[assembly: AssemblyFileVersion("2.4.10")]
|
||||
[assembly: AssemblyVersion("2.4.11")]
|
||||
[assembly: AssemblyFileVersion("2.4.11")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyCompany("Clemens Fischer")]
|
||||
[assembly: AssemblyCopyright("© 2015 Clemens Fischer")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyVersion("2.4.10")]
|
||||
[assembly: AssemblyFileVersion("2.4.10")]
|
||||
[assembly: AssemblyVersion("2.4.11")]
|
||||
[assembly: AssemblyFileVersion("2.4.11")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyCompany("Clemens Fischer")]
|
||||
[assembly: AssemblyCopyright("© 2015 Clemens Fischer")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyVersion("2.4.10")]
|
||||
[assembly: AssemblyFileVersion("2.4.10")]
|
||||
[assembly: AssemblyVersion("2.4.11")]
|
||||
[assembly: AssemblyFileVersion("2.4.11")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyCompany("Clemens Fischer")]
|
||||
[assembly: AssemblyCopyright("© 2015 Clemens Fischer")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyVersion("2.4.10")]
|
||||
[assembly: AssemblyFileVersion("2.4.10")]
|
||||
[assembly: AssemblyVersion("2.4.11")]
|
||||
[assembly: AssemblyFileVersion("2.4.11")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
|
|
|||
|
|
@ -94,6 +94,7 @@
|
|||
</Style>
|
||||
|
||||
<Style x:Key="PointItemStyle" TargetType="map:MapItem">
|
||||
<EventSetter Event="TouchDown" Handler="MapItemTouchDown"/>
|
||||
<Setter Property="map:MapPanel.Location" Value="{Binding Location}"/>
|
||||
<Setter Property="Foreground" Value="Black"/>
|
||||
<Setter Property="Template">
|
||||
|
|
@ -140,11 +141,18 @@
|
|||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<EventSetter Event="TouchDown" Handler="MapItemTouchDown"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter Property="Panel.ZIndex" Value="1"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="PushpinItemStyle" TargetType="map:MapItem">
|
||||
<EventSetter Event="TouchDown" Handler="MapItemTouchDown"/>
|
||||
<Setter Property="map:MapPanel.Location" Value="{Binding Location}"/>
|
||||
<Setter Property="VerticalAlignment" Value="Bottom"/>
|
||||
<Setter Property="Foreground" Value="Black"/>
|
||||
<Setter Property="Visibility">
|
||||
<Setter.Value>
|
||||
<MultiBinding Converter="{StaticResource LocationToVisibilityConverter}">
|
||||
|
|
@ -153,17 +161,16 @@
|
|||
</MultiBinding>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="VerticalAlignment" Value="Bottom"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="map:MapItem">
|
||||
<map:Pushpin Content="{Binding Name}"/>
|
||||
<map:Pushpin Content="{Binding Name}" Foreground="{TemplateBinding Foreground}"/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<EventSetter Event="TouchDown" Handler="MapItemTouchDown"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter Property="Panel.ZIndex" Value="1"/>
|
||||
<Setter Property="Foreground" Value="OrangeRed"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyCompany("Clemens Fischer")]
|
||||
[assembly: AssemblyCopyright("© 2015 Clemens Fischer")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyVersion("2.4.10")]
|
||||
[assembly: AssemblyFileVersion("2.4.10")]
|
||||
[assembly: AssemblyVersion("2.4.11")]
|
||||
[assembly: AssemblyFileVersion("2.4.11")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
|
|
|||
Loading…
Reference in a new issue