Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
IOSHelpers.cs
1using UIKit;
2
4{
5 internal static class IOSHelpers
6 {
7 internal static UIWindow? GetWindow()
8 {
9 if (UIDevice.CurrentDevice.CheckSystemVersion(15, 0))
10 {
11 return UIApplication.SharedApplication.ConnectedScenes
12 .OfType<UIWindowScene>()
13 .SelectMany(s => s.Windows)
14 .FirstOrDefault(w => w.IsKeyWindow);
15 }
16 else if (UIDevice.CurrentDevice.CheckSystemVersion(14, 2))
17 return UIApplication.SharedApplication.Windows.FirstOrDefault(o => o.IsKeyWindow);
18 else
19 return UIApplication.SharedApplication.KeyWindow;
20 }
21
22 internal static ThemeStyle GetCurrentTheme()
23 {
24 return Application.Current?.RequestedTheme == AppTheme.Dark
25 ? ThemeStyle.Dark : ThemeStyle.Light;
26 }
27 }
28}