feat: clean up warnings.

This commit is contained in:
rabbitism
2024-07-30 18:33:30 +08:00
parent e1f91f612b
commit 15fb5a2d1b
167 changed files with 473 additions and 825 deletions

View File

@@ -14,10 +14,10 @@ public enum ControlStatus
public class MenuItemViewModel: ViewModelBase
{
public string MenuHeader { get; set; }
public string MenuIconName { get; set; }
public string Key { get; set; }
public string Status { get; set; }
public string? MenuHeader { get; set; }
public string? MenuIconName { get; set; }
public string? Key { get; set; }
public string? Status { get; set; }
public bool IsSeparator { get; set; }
public ObservableCollection<MenuItemViewModel> Children { get; set; } = new();
@@ -31,7 +31,7 @@ public class MenuItemViewModel: ViewModelBase
private void OnActivate()
{
if (IsSeparator) return;
WeakReferenceMessenger.Default.Send<string>(Key);
if (IsSeparator || Key is null) return;
WeakReferenceMessenger.Default.Send(Key);
}
}