Resolving warnings and treating warnings as errors in WinUI project. (#824)

This commit is contained in:
Burak Kaan Köse
2026-02-27 20:12:43 +01:00
committed by GitHub
parent d2fce5eee1
commit 0e742c7a8f
55 changed files with 336 additions and 269 deletions
@@ -10,21 +10,21 @@ namespace Wino.Dialogs;
public sealed partial class CustomThemeBuilderDialog : ContentDialog
{
public byte[] WallpaperData { get; private set; }
public string AccentColor { get; private set; }
public byte[] WallpaperData { get; private set; } = Array.Empty<byte>();
public string AccentColor { get; private set; } = string.Empty;
private INewThemeService _themeService;
private readonly INewThemeService _themeService;
public CustomThemeBuilderDialog()
{
InitializeComponent();
_themeService = WinoApplication.Current.Services.GetService<INewThemeService>();
_themeService = WinoApplication.Current.Services.GetRequiredService<INewThemeService>();
}
private async void ApplyClicked(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
if (Array.Empty<byte>() == WallpaperData)
if (WallpaperData.Length == 0)
return;
var deferal = args.GetDeferral();
@@ -45,11 +45,11 @@ public sealed partial class CustomThemeBuilderDialog : ContentDialog
private async void BrowseWallpaperClicked(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
{
var dialogService = WinoApplication.Current.Services.GetService<IMailDialogService>();
var dialogService = WinoApplication.Current.Services.GetRequiredService<IMailDialogService>();
var pickedFileData = await dialogService.PickWindowsFileContentAsync(".jpg", ".png");
if (pickedFileData == Array.Empty<byte>()) return;
if (pickedFileData.Length == 0) return;
IsPrimaryButtonEnabled = true;