mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-08 16:05:50 +00:00
Code cleanup
This commit is contained in:
parent
03e0258f18
commit
497c415562
2 changed files with 15 additions and 18 deletions
|
|
@ -238,23 +238,20 @@ namespace MapControl
|
|||
element = (FrameworkElement)template.LoadContent();
|
||||
}
|
||||
#endif
|
||||
if (element != null)
|
||||
{
|
||||
element.DataContext = layer;
|
||||
}
|
||||
element?.DataContext = layer;
|
||||
|
||||
return element;
|
||||
}
|
||||
|
||||
#if UWP || WINUI
|
||||
private static object TryFindResource(FrameworkElement element, object key)
|
||||
{
|
||||
return element.Resources.ContainsKey(key)
|
||||
? element.Resources[key]
|
||||
: element.Parent is FrameworkElement parent
|
||||
? TryFindResource(parent, key)
|
||||
: null;
|
||||
}
|
||||
private static object TryFindResource(FrameworkElement element, object key)
|
||||
{
|
||||
return element.Resources.ContainsKey(key)
|
||||
? element.Resources[key]
|
||||
: element.Parent is FrameworkElement parent
|
||||
? TryFindResource(parent, key)
|
||||
: null;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue