diff --git a/Caching/FileDbCache/Properties/AssemblyInfo.cs b/Caching/FileDbCache/Properties/AssemblyInfo.cs
index 1ccc79f5..2794ffbc 100644
--- a/Caching/FileDbCache/Properties/AssemblyInfo.cs
+++ b/Caching/FileDbCache/Properties/AssemblyInfo.cs
@@ -8,8 +8,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("Copyright © Clemens Fischer 2012-2013")]
[assembly: AssemblyTrademark("")]
-[assembly: AssemblyVersion("1.3.8")]
-[assembly: AssemblyFileVersion("1.3.8")]
+[assembly: AssemblyVersion("1.3.9")]
+[assembly: AssemblyFileVersion("1.3.9")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
diff --git a/Caching/ImageFileCache/Properties/AssemblyInfo.cs b/Caching/ImageFileCache/Properties/AssemblyInfo.cs
index 0374992d..8edbc738 100644
--- a/Caching/ImageFileCache/Properties/AssemblyInfo.cs
+++ b/Caching/ImageFileCache/Properties/AssemblyInfo.cs
@@ -8,8 +8,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("Copyright © Clemens Fischer 2012-2013")]
[assembly: AssemblyTrademark("")]
-[assembly: AssemblyVersion("1.3.8")]
-[assembly: AssemblyFileVersion("1.3.8")]
+[assembly: AssemblyVersion("1.3.9")]
+[assembly: AssemblyFileVersion("1.3.9")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
diff --git a/MapControl/MapControl.Silverlight.csproj b/MapControl/MapControl.Silverlight.csproj
index 866f943a..72dcdfb1 100644
--- a/MapControl/MapControl.Silverlight.csproj
+++ b/MapControl/MapControl.Silverlight.csproj
@@ -76,7 +76,6 @@
-
diff --git a/MapControl/MapControl.WPF.csproj b/MapControl/MapControl.WPF.csproj
index 7b9844b7..4bffa4a8 100644
--- a/MapControl/MapControl.WPF.csproj
+++ b/MapControl/MapControl.WPF.csproj
@@ -57,7 +57,6 @@
-
diff --git a/MapControl/MapItem.WPF.cs b/MapControl/MapItem.WPF.cs
index a4be3eea..56f9a237 100644
--- a/MapControl/MapItem.WPF.cs
+++ b/MapControl/MapItem.WPF.cs
@@ -10,41 +10,12 @@ namespace MapControl
///
/// Container class for an item in a MapItemsControl.
///
- [TemplateVisualState(Name = "NotCurrent", GroupName = "CurrentStates")]
- [TemplateVisualState(Name = "Current", GroupName = "CurrentStates")]
public class MapItem : ListBoxItem
{
- public static readonly DependencyProperty IsCurrentProperty = MapItemsControl.IsCurrentProperty.AddOwner(
- typeof(MapItem), new PropertyMetadata((o, e) => ((MapItem)o).IsCurrentPropertyChanged((bool)e.NewValue)));
-
static MapItem()
{
- FrameworkElement.DefaultStyleKeyProperty.OverrideMetadata(
+ DefaultStyleKeyProperty.OverrideMetadata(
typeof(MapItem), new FrameworkPropertyMetadata(typeof(MapItem)));
}
-
- ///
- /// Gets a value that indicates if the MapItem is the CurrentItem of the containing items collection.
- ///
- public bool IsCurrent
- {
- get { return (bool)GetValue(IsCurrentProperty); }
- }
-
- private void IsCurrentPropertyChanged(bool isCurrent)
- {
- var zIndex = Panel.GetZIndex(this);
-
- if (isCurrent)
- {
- Panel.SetZIndex(this, zIndex | 0x40000000);
- VisualStateManager.GoToState(this, "Current", true);
- }
- else
- {
- Panel.SetZIndex(this, zIndex & ~0x40000000);
- VisualStateManager.GoToState(this, "NotCurrent", true);
- }
- }
}
}
diff --git a/MapControl/MapItemsControl.Silverlight.WinRT.cs b/MapControl/MapItemsControl.Silverlight.WinRT.cs
index 206ac8e7..ba329316 100644
--- a/MapControl/MapItemsControl.Silverlight.WinRT.cs
+++ b/MapControl/MapItemsControl.Silverlight.WinRT.cs
@@ -2,14 +2,30 @@
// Copyright © Clemens Fischer 2012-2013
// Licensed under the Microsoft Public License (Ms-PL)
+#if NETFX_CORE
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+#else
+using System.Windows;
+using System.Windows.Controls;
+#endif
+
namespace MapControl
{
- public partial class MapItemsControl
+ ///
+ /// Manages a collection of selectable items on a Map. Uses MapItem as item container class.
+ ///
+ public class MapItemsControl : ListBox
{
public MapItemsControl()
{
DefaultStyleKey = typeof(MapItemsControl);
MapPanel.AddParentMapHandlers(this);
}
+
+ protected override DependencyObject GetContainerForItemOverride()
+ {
+ return new MapItem();
+ }
}
-}
\ No newline at end of file
+}
diff --git a/MapControl/MapItemsControl.WPF.cs b/MapControl/MapItemsControl.WPF.cs
index 25620a06..48cd5d42 100644
--- a/MapControl/MapItemsControl.WPF.cs
+++ b/MapControl/MapItemsControl.WPF.cs
@@ -12,30 +12,35 @@ using System.Windows.Media;
namespace MapControl
{
- public partial class MapItemsControl
+ ///
+ /// Manages a collection of selectable items on a Map. Uses MapItem as item container class.
+ ///
+ public class MapItemsControl : ListBox
{
public static readonly DependencyProperty SelectionGeometryProperty = DependencyProperty.Register(
"SelectionGeometry", typeof(Geometry), typeof(MapItemsControl),
new PropertyMetadata((o, e) => ((MapItemsControl)o).SelectionGeometryPropertyChanged((Geometry)e.NewValue)));
- public static readonly DependencyProperty IsCurrentProperty = DependencyProperty.RegisterAttached(
- "IsCurrent", typeof(bool), typeof(MapItemsControl), null);
-
static MapItemsControl()
{
- FrameworkElement.DefaultStyleKeyProperty.OverrideMetadata(
+ DefaultStyleKeyProperty.OverrideMetadata(
typeof(MapItemsControl), new FrameworkPropertyMetadata(typeof(MapItemsControl)));
}
public MapItemsControl()
{
- Items.CurrentChanging += OnCurrentItemChanging;
- Items.CurrentChanged += OnCurrentItemChanged;
+ Items.CurrentChanging += CurrentItemChanging;
+ Items.CurrentChanged += CurrentItemChanged;
+ }
+
+ protected override DependencyObject GetContainerForItemOverride()
+ {
+ return new MapItem();
}
///
- /// Gets or sets a Geometry that selects all items that lie inside its fill area,
- /// i.e. where Geometry.FillContains returns true for the item's viewport position.
+ /// Gets or sets a Geometry that selects all items inside its fill area, i.e.
+ /// where Geometry.FillContains returns true for the item's viewport position.
///
public Geometry SelectionGeometry
{
@@ -43,11 +48,6 @@ namespace MapControl
set { SetValue(SelectionGeometryProperty, value); }
}
- public static bool GetIsCurrent(UIElement element)
- {
- return (bool)element.GetValue(IsCurrentProperty);
- }
-
public object GetFirstItemInGeometry(Geometry geometry)
{
if (geometry == null || geometry.IsEmpty())
@@ -62,30 +62,20 @@ namespace MapControl
{
if (geometry == null || geometry.IsEmpty())
{
- return new List