Initial commit.

This commit is contained in:
Burak Kaan Köse
2024-04-18 01:44:37 +02:00
parent 524ea4c0e1
commit 12d3814626
671 changed files with 77295 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
using Windows.UI.ViewManagement;
using Windows.UI.Xaml;
using Wino.Core.Domain.Interfaces;
namespace Wino.Core.UWP.Services
{
public class UnderlyingThemeService : IUnderlyingThemeService
{
public const string SelectedAppThemeKey = nameof(SelectedAppThemeKey);
private readonly UISettings uiSettings = new UISettings();
private readonly IConfigurationService _configurationService;
public UnderlyingThemeService(IConfigurationService configurationService)
{
_configurationService = configurationService;
}
// This should not rely on application window to be present.
// Check theme from the settings, rely on UISettings background color if Default.
public bool IsUnderlyingThemeDark()
{
var currentTheme = _configurationService.Get(SelectedAppThemeKey, ElementTheme.Default);
if (currentTheme == ElementTheme.Default)
return uiSettings.GetColorValue(UIColorType.Background).ToString() == "#FF000000";
else
return currentTheme == ElementTheme.Dark;
}
}
}