2
2
3
3
namespace MauiBlazorToolkit . Platform ;
4
4
5
- [ SupportedOSPlatform ( "MacCatalyst10 .0" ) , UnsupportedOSPlatform ( "MacOS" ) ]
5
+ [ SupportedOSPlatform ( "MacCatalyst11 .0" ) , UnsupportedOSPlatform ( "MacOS" ) ]
6
6
static partial class TitleBar
7
7
{
8
8
static UIKit . UIWindow ? NativeWindow =>
9
9
( UIKit . UIWindow ? ) Application . Current ? . Windows . FirstOrDefault ( ) ? . Handler ? . PlatformView ;
10
10
11
11
static ResourceDictionary ? Resources => Application . Current ? . Resources ;
12
+
12
13
static void PlatformSetColor ( Color color )
13
14
{
14
- if ( Resources == null ) return ;
15
+ if ( Resources is null ) return ;
15
16
Resources [ "PageBackgroundColor" ] = color ;
16
17
}
17
18
18
19
static void PlatformSetStyle ( TitleBarStyle style )
19
20
{
20
- if ( Resources == null ) return ;
21
+ if ( Resources is null ) return ;
21
22
var color = style switch
22
23
{
23
24
TitleBarStyle . Default => Colors . Black ,
24
25
TitleBarStyle . LightContent => Colors . White ,
25
26
TitleBarStyle . DarkContent => Colors . Black ,
26
- _ => throw new NotSupportedException ( $ "{ nameof ( TitleBarStyle ) } { style } is not yet supported on iOS ")
27
+ _ => throw new NotSupportedException ( $ "{ nameof ( TitleBarStyle ) } { style } is not yet supported on MacCatalyst ")
27
28
} ;
28
29
Resources [ "PrimaryTextColor" ] = color ;
29
30
}
30
31
31
32
public static void Initialize ( )
32
33
{
33
- if ( NativeWindow == null ) return ;
34
+ if ( NativeWindow is null ) return ;
34
35
var titleBar = NativeWindow . WindowScene ? . Titlebar ;
35
- if ( titleBar == null ) return ;
36
+ if ( titleBar is null ) return ;
36
37
titleBar . TitleVisibility = UIKit . UITitlebarTitleVisibility . Hidden ;
37
38
}
38
39
}
0 commit comments