Skip to content

Commit

Permalink
In progress: refactor GetIconByTheme()
Browse files Browse the repository at this point in the history
  • Loading branch information
lauren-ciha committed Oct 23, 2024
1 parent 7225b3a commit a7887a7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tools/SetupFlow/DevHome.SetupFlow/ViewModels/PackageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using DevHome.Services.WindowsPackageManager.Contracts;
using DevHome.SetupFlow.Models;
using DevHome.SetupFlow.Services;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media.Imaging;
using Windows.Storage.Streams;
using Windows.System;
Expand Down Expand Up @@ -202,6 +203,15 @@ private void ToggleSelection()
_screenReaderService.Announce(announcementText);
}

private BitmapImage GetIconByTheme()
{
return _themeSelector.GetActualTheme() switch
{
ElementTheme.Dark => _package.DarkThemeIcon == null ? DefaultDarkPackageIconSource : CreateBitmapImage(_package.DarkThemeIcon),
_ => _package.LightThemeIcon == null ? DefaultLightPackageIconSource : CreateBitmapImage(_package.LightThemeIcon),
};
}

public BitmapImage GetLightThemeIcon()
{
return _package.LightThemeIcon == null ? DefaultLightPackageIconSource : CreateBitmapImage(_package.LightThemeIcon);
Expand Down

0 comments on commit a7887a7

Please sign in to comment.