mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-07 15:36:20 +00:00
DependencyPropertyHelper
This commit is contained in:
parent
c74c2b1fed
commit
8e82e0bcbd
25 changed files with 224 additions and 176 deletions
|
|
@ -2,6 +2,7 @@
|
|||
// Copyright © 2024 Clemens Fischer
|
||||
// Licensed under the Microsoft Public License (Ms-PL)
|
||||
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.Linq;
|
||||
|
|
@ -39,14 +40,14 @@ namespace MapControl
|
|||
|
||||
#region Methods used only by derived classes MapPolyline and MapPolygon
|
||||
|
||||
protected void DataCollectionPropertyChanged(DependencyPropertyChangedEventArgs e)
|
||||
protected void DataCollectionPropertyChanged(IEnumerable oldValue, IEnumerable newValue)
|
||||
{
|
||||
if (e.OldValue is INotifyCollectionChanged oldCollection)
|
||||
if (oldValue is INotifyCollectionChanged oldCollection)
|
||||
{
|
||||
oldCollection.CollectionChanged -= DataCollectionChanged;
|
||||
}
|
||||
|
||||
if (e.NewValue is INotifyCollectionChanged newCollection)
|
||||
if (newValue is INotifyCollectionChanged newCollection)
|
||||
{
|
||||
newCollection.CollectionChanged += DataCollectionChanged;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue