Skip to content

Commit

Permalink
Refactor GetLight/DarkThemeIcon()
Browse files Browse the repository at this point in the history
  • Loading branch information
lauren-ciha committed Oct 21, 2024
1 parent 6aabbd9 commit 5803453
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions tools/SetupFlow/DevHome.SetupFlow/ViewModels/PackageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using System.Collections.Generic;
using System.Reflection.Metadata.Ecma335;
using System.Threading.Tasks;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
Expand Down Expand Up @@ -205,22 +206,12 @@ private void ToggleSelection()

public BitmapImage GetLightThemeIcon()
{
if (_package.LightThemeIcon != null)
{
return CreateBitmapImage(_package.LightThemeIcon);
}

return DefaultDarkPackageIconSource;
return _packageLightThemeIcon == null ? DefaultLightPackageIconSource : CreateBitmapImage(_package.LightThemeIcon);
}

public BitmapImage GetDarkThemeIcon()
{
if (_package.DarkThemeIcon != null)
{
return CreateBitmapImage(_package.DarkThemeIcon);
}

return DefaultDarkPackageIconSource;
return _packageDarkThemeIcon == null ? DefaultDarkPackageIconSource : CreateBitmapImage(_package.DarkThemeIcon);
}

private BitmapImage CreateBitmapImage(IRandomAccessStream stream)
Expand Down

0 comments on commit 5803453

Please sign in to comment.