mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
MapItemsControl implementation
This commit is contained in:
parent
367d54037f
commit
e3b221a80b
4 changed files with 35 additions and 48 deletions
|
|
@ -2,12 +2,15 @@
|
|||
#if WPF
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
#elif UWP
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Data;
|
||||
#elif WINUI
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
@ -114,5 +117,26 @@ namespace MapControl
|
|||
SelectItemsInRect(new Rect(xMin, yMin, xMax - xMin, yMax - yMin));
|
||||
}
|
||||
}
|
||||
|
||||
private void PrepareContainer(DependencyObject container, object item)
|
||||
{
|
||||
if (LocationMemberPath != null && container is MapItem mapItem)
|
||||
{
|
||||
mapItem.SetBinding(MapItem.LocationProperty,
|
||||
new Binding
|
||||
{
|
||||
Path = new PropertyPath(LocationMemberPath),
|
||||
Source = item
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void ClearContainer(DependencyObject container)
|
||||
{
|
||||
if (LocationMemberPath != null && container is MapItem mapItem)
|
||||
{
|
||||
mapItem.ClearValue(MapItem.LocationProperty);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue