Fix possible null assignment to non-nullable entities.

This commit is contained in:
2023-10-04 09:55:17 +01:00
parent 2a6e052a62
commit bc8bf7a2dc
27 changed files with 55 additions and 36 deletions

View File

@@ -190,9 +190,15 @@ public sealed class MainWindowViewModel : ViewModelBase
set => this.RaiseAndSetIfChanged(ref _devicesSupported, value);
}
public bool NativeMenuSupported =>
NativeMenu.GetIsNativeMenuExported((Application.Current?.ApplicationLifetime as
IClassicDesktopStyleApplicationLifetime)?.MainWindow);
public bool NativeMenuSupported
{
get
{
Window mainWindow = (Application.Current?.ApplicationLifetime as
IClassicDesktopStyleApplicationLifetime)?.MainWindow;
return mainWindow is not null && NativeMenu.GetIsNativeMenuExported(mainWindow);
}
}
[NotNull]
public string Greeting => UI.Welcome_to_Aaru;