XAML-Map-Control/SampleApps/UniversalApp/BindingHelper.cs
ClemensF 98cdc95c5d Version 2.5.0:
- moved tile rect calculation from MapBase to TileLayer
- added TileLayer.ZoomLevelOffset property
- Windows Universal sample application in solution MapControl VS2015
2015-08-09 20:04:44 +02:00

37 lines
1.1 KiB
C#

using MapControl;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Data;
namespace UniversalApp
{
public class BindingHelper
{
public static readonly DependencyProperty LocationPathProperty = DependencyProperty.RegisterAttached(
"LocationPath", typeof(string), typeof(BindingHelper),
new PropertyMetadata(null, LocationPathPropertyChanged));
public static string GetLocationPath(DependencyObject obj)
{
return (string)obj.GetValue(LocationPathProperty);
}
public static void SetLocationPath(DependencyObject obj, string value)
{
obj.SetValue(LocationPathProperty, value);
}
private static void LocationPathPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
{
var propertyPath = e.NewValue as string;
if (propertyPath != null)
{
BindingOperations.SetBinding(
obj,
MapPanel.LocationProperty,
new Binding { Path = new PropertyPath(propertyPath) });
}
}
}
}