mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-20 22:05:07 +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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,4 @@
|
|||
#if AVALONIA
|
||||
global using UIElement = Avalonia.Controls.Control;
|
||||
global using FrameworkElement = Avalonia.Controls.Control;
|
||||
using Avalonia;
|
||||
using Avalonia.Media;
|
||||
#elif WPF
|
||||
#if WPF
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
#elif UWP
|
||||
|
|
@ -12,6 +7,11 @@ using Windows.UI.Xaml.Media;
|
|||
#elif WINUI
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
#elif AVALONIA
|
||||
global using UIElement = Avalonia.Controls.Control;
|
||||
global using FrameworkElement = Avalonia.Controls.Control;
|
||||
using Avalonia;
|
||||
using Avalonia.Media;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue