mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-07 23:45:05 +00:00
Removed LocationPath property from MapItem and PushPin.
This commit is contained in:
parent
b0ecd850a2
commit
d0d949c9be
17 changed files with 88 additions and 133 deletions
|
|
@ -75,7 +75,6 @@
|
|||
<Compile Include="MapBase.Silverlight.WinRT.cs" />
|
||||
<Compile Include="MapGraticule.cs" />
|
||||
<Compile Include="MapGraticule.Silverlight.WinRT.cs" />
|
||||
<Compile Include="MapItem.cs" />
|
||||
<Compile Include="MapItem.Silverlight.WinRT.cs" />
|
||||
<Compile Include="MapItemsControl.cs" />
|
||||
<Compile Include="MapItemsControl.Silverlight.WinRT.cs" />
|
||||
|
|
@ -89,7 +88,6 @@
|
|||
<Compile Include="MatrixEx.cs" />
|
||||
<Compile Include="MercatorTransform.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Pushpin.cs" />
|
||||
<Compile Include="Pushpin.Silverlight.WinRT.cs" />
|
||||
<Compile Include="Tile.cs" />
|
||||
<Compile Include="Tile.Silverlight.WinRT.cs" />
|
||||
|
|
|
|||
|
|
@ -57,7 +57,6 @@
|
|||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MapBase.WPF.cs" />
|
||||
<Compile Include="MapItem.cs" />
|
||||
<Compile Include="MapItem.WPF.cs" />
|
||||
<Compile Include="MapItemsControl.cs" />
|
||||
<Compile Include="MapItemsControl.WPF.cs" />
|
||||
|
|
@ -68,7 +67,6 @@
|
|||
<Compile Include="MapTransform.cs" />
|
||||
<Compile Include="MercatorTransform.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Pushpin.cs" />
|
||||
<Compile Include="Pushpin.WPF.cs" />
|
||||
<Compile Include="Tile.cs" />
|
||||
<Compile Include="Tile.WPF.cs" />
|
||||
|
|
|
|||
|
|
@ -2,9 +2,18 @@
|
|||
// Copyright © 2012 Clemens Fischer
|
||||
// Licensed under the Microsoft Public License (Ms-PL)
|
||||
|
||||
#if WINRT
|
||||
using Windows.UI.Xaml.Controls;
|
||||
#else
|
||||
using System.Windows.Controls;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
{
|
||||
public partial class MapItem
|
||||
/// <summary>
|
||||
/// Container class for an item in a MapItemsControl.
|
||||
/// </summary>
|
||||
public class MapItem : ListBoxItem
|
||||
{
|
||||
public MapItem()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,9 +7,12 @@ using System.Windows.Controls;
|
|||
|
||||
namespace MapControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Container class for an item in a MapItemsControl.
|
||||
/// </summary>
|
||||
[TemplateVisualState(Name = "NotCurrent", GroupName = "CurrentStates")]
|
||||
[TemplateVisualState(Name = "Current", GroupName = "CurrentStates")]
|
||||
public partial class MapItem
|
||||
public class MapItem : ListBoxItem
|
||||
{
|
||||
public static readonly DependencyProperty IsCurrentProperty = MapItemsControl.IsCurrentProperty.AddOwner(
|
||||
typeof(MapItem),
|
||||
|
|
|
|||
|
|
@ -1,49 +0,0 @@
|
|||
// XAML Map Control - http://xamlmapcontrol.codeplex.com/
|
||||
// Copyright © 2012 Clemens Fischer
|
||||
// Licensed under the Microsoft Public License (Ms-PL)
|
||||
|
||||
#if WINRT
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Data;
|
||||
#else
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Container class for an item in a MapItemsControl.
|
||||
/// </summary>
|
||||
public partial class MapItem : ListBoxItem
|
||||
{
|
||||
public static readonly DependencyProperty LocationPathProperty = DependencyProperty.Register(
|
||||
"LocationPath", typeof(string), typeof(MapItem), new PropertyMetadata(null, LocationPathPropertyChanged));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the property path that is used to bind the MapPanel.Location attached property.
|
||||
/// </summary>
|
||||
public string LocationPath
|
||||
{
|
||||
get { return (string)GetValue(LocationPathProperty); }
|
||||
set { SetValue(LocationPathProperty, value); }
|
||||
}
|
||||
|
||||
private static void LocationPathPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
string path = e.NewValue as string;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(path))
|
||||
{
|
||||
var binding = new Binding
|
||||
{
|
||||
Path = new PropertyPath(path)
|
||||
};
|
||||
|
||||
BindingOperations.SetBinding(obj, MapPanel.LocationProperty, binding);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2,9 +2,18 @@
|
|||
// Copyright © 2012 Clemens Fischer
|
||||
// Licensed under the Microsoft Public License (Ms-PL)
|
||||
|
||||
#if WINRT
|
||||
using Windows.UI.Xaml.Controls;
|
||||
#else
|
||||
using System.Windows.Controls;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
{
|
||||
public partial class Pushpin
|
||||
/// <summary>
|
||||
/// Displays a pushpin at a geographic location provided by the MapPanel.Location attached property.
|
||||
/// </summary>
|
||||
public class Pushpin : ContentControl
|
||||
{
|
||||
public Pushpin()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,10 +3,14 @@
|
|||
// Licensed under the Microsoft Public License (Ms-PL)
|
||||
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace MapControl
|
||||
{
|
||||
public partial class Pushpin
|
||||
/// <summary>
|
||||
/// Displays a pushpin at a geographic location provided by the MapPanel.Location attached property.
|
||||
/// </summary>
|
||||
public class Pushpin : ContentControl
|
||||
{
|
||||
static Pushpin()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,49 +0,0 @@
|
|||
// XAML Map Control - http://xamlmapcontrol.codeplex.com/
|
||||
// Copyright © 2012 Clemens Fischer
|
||||
// Licensed under the Microsoft Public License (Ms-PL)
|
||||
|
||||
#if WINRT
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Data;
|
||||
#else
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Displays a pushpin at a geographic location provided by the MapPanel.Location attached property.
|
||||
/// </summary>
|
||||
public partial class Pushpin : ContentControl
|
||||
{
|
||||
public static readonly DependencyProperty LocationPathProperty = DependencyProperty.Register(
|
||||
"LocationPath", typeof(string), typeof(Pushpin), new PropertyMetadata(null, LocationPathPropertyChanged));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the property path that is used to bind the MapPanel.Location attached property.
|
||||
/// </summary>
|
||||
public string LocationPath
|
||||
{
|
||||
get { return (string)GetValue(LocationPathProperty); }
|
||||
set { SetValue(LocationPathProperty, value); }
|
||||
}
|
||||
|
||||
private static void LocationPathPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
string path = e.NewValue as string;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(path))
|
||||
{
|
||||
var binding = new Binding
|
||||
{
|
||||
Path = new PropertyPath(path)
|
||||
};
|
||||
|
||||
BindingOperations.SetBinding(obj, MapPanel.LocationProperty, binding);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -217,8 +217,8 @@ namespace MapControl
|
|||
var request = (HttpWebRequest)WebRequest.Create(uri);
|
||||
request.UserAgent = typeof(TileImageLoader).ToString();
|
||||
|
||||
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
|
||||
using (Stream responseStream = response.GetResponseStream())
|
||||
using (var response = (HttpWebResponse)request.GetResponse())
|
||||
using (var responseStream = response.GetResponseStream())
|
||||
{
|
||||
var length = response.ContentLength;
|
||||
var creationTime = DateTime.UtcNow.ToBinary();
|
||||
|
|
|
|||
|
|
@ -129,9 +129,6 @@
|
|||
<Compile Include="..\MapGraticule.Silverlight.WinRT.cs">
|
||||
<Link>MapGraticule.Silverlight.WinRT.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\MapItem.cs">
|
||||
<Link>MapItem.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\MapItem.Silverlight.WinRT.cs">
|
||||
<Link>MapItem.Silverlight.WinRT.cs</Link>
|
||||
</Compile>
|
||||
|
|
@ -168,9 +165,6 @@
|
|||
<Compile Include="..\MercatorTransform.cs">
|
||||
<Link>MercatorTransform.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Pushpin.cs">
|
||||
<Link>Pushpin.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Pushpin.Silverlight.WinRT.cs">
|
||||
<Link>Pushpin.Silverlight.WinRT.cs</Link>
|
||||
</Compile>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue