mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-04 14:08:32 +00:00
Fixed casting bug in DependencyPropertyHelper
This commit is contained in:
parent
8b08a3b8e6
commit
d863c374c7
2 changed files with 16 additions and 4 deletions
|
|
@ -71,7 +71,13 @@ namespace MapControl
|
|||
|
||||
if (changed != null)
|
||||
{
|
||||
metadata.PropertyChangedCallback = (o, e) => changed((FrameworkElement)o, (TValue)e.OldValue, (TValue)e.NewValue);
|
||||
metadata.PropertyChangedCallback = (o, e) =>
|
||||
{
|
||||
if (o is FrameworkElement element)
|
||||
{
|
||||
changed(element, (TValue)e.OldValue, (TValue)e.NewValue);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return DependencyProperty.RegisterAttached(name, typeof(TValue), typeof(TOwner), metadata);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue