Include WinUI reference
This commit is contained in:
@@ -7,6 +7,9 @@
|
|||||||
<LangVersion>9.0</LangVersion>
|
<LangVersion>9.0</LangVersion>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.UI.Xaml" Version="2.5.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\NotificationFlyout.Uwp.UI.Controls\NotificationFlyout.Uwp.UI.Controls.csproj" />
|
<ProjectReference Include="..\NotificationFlyout.Uwp.UI.Controls\NotificationFlyout.Uwp.UI.Controls.csproj" />
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
x:Class="NotificationFlyout.Sample.Uwp.NotificationFlyoutPresenter"
|
x:Class="NotificationFlyout.Sample.Uwp.NotificationFlyoutPresenter"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:controls="using:NotificationFlyout.Uwp.UI.Controls">
|
xmlns:winui="using:Microsoft.UI.Xaml.Controls">
|
||||||
<StackPanel
|
<StackPanel
|
||||||
Width="330"
|
Width="330"
|
||||||
Height="500"
|
Height="500"
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Windows.UI.ViewManagement;
|
|
||||||
|
|
||||||
namespace NotificationFlyout.Shared.UI.Helpers
|
|
||||||
{
|
|
||||||
public class SystemPersonalisationHelper
|
|
||||||
{
|
|
||||||
private readonly UISettings _settings = new UISettings();
|
|
||||||
|
|
||||||
private SystemPersonalisationHelper()
|
|
||||||
{
|
|
||||||
_settings.ColorValuesChanged += _settings_ColorValuesChanged;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void _settings_ColorValuesChanged(UISettings sender, object args)
|
|
||||||
{
|
|
||||||
ThemeChanged?.Invoke(this, EventArgs.Empty);
|
|
||||||
}
|
|
||||||
|
|
||||||
public event EventHandler ThemeChanged;
|
|
||||||
|
|
||||||
public SystemTheme SystemTheme => GetSystemTheme();
|
|
||||||
|
|
||||||
public static SystemPersonalisationHelper Create()
|
|
||||||
{
|
|
||||||
return new SystemPersonalisationHelper();
|
|
||||||
}
|
|
||||||
|
|
||||||
private SystemTheme GetSystemTheme()
|
|
||||||
{
|
|
||||||
var uiTheme = _settings.GetColorValue(UIColorType.Background).ToString();
|
|
||||||
return uiTheme == "#FFFFFFFF" ? SystemTheme.Light : SystemTheme.Dark;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
namespace NotificationFlyout.Shared.UI.Helpers
|
|
||||||
{
|
|
||||||
public enum SystemTheme
|
|
||||||
{
|
|
||||||
Dark,
|
|
||||||
Light,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.19041.1" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
@@ -2,4 +2,8 @@
|
|||||||
x:Class="NotificationFlyout.XamlHost.App"
|
x:Class="NotificationFlyout.XamlHost.App"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:xamlhost="using:Microsoft.Toolkit.Win32.UI.XamlHost" />
|
xmlns:xamlhost="using:Microsoft.Toolkit.Win32.UI.XamlHost">
|
||||||
|
<xamlhost:XamlApplication.Resources>
|
||||||
|
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
|
||||||
|
</xamlhost:XamlApplication.Resources>
|
||||||
|
</xamlhost:XamlApplication>
|
||||||
@@ -149,6 +149,9 @@
|
|||||||
<PackageReference Include="Microsoft.Toolkit.Win32.UI.XamlApplication">
|
<PackageReference Include="Microsoft.Toolkit.Win32.UI.XamlApplication">
|
||||||
<Version>6.1.2</Version>
|
<Version>6.1.2</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
<PackageReference Include="Microsoft.UI.Xaml">
|
||||||
|
<Version>2.5.0-prerelease.201202003</Version>
|
||||||
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\NotificationFlyout.Uwp.UI.Controls\NotificationFlyout.Uwp.UI.Controls.csproj">
|
<ProjectReference Include="..\NotificationFlyout.Uwp.UI.Controls\NotificationFlyout.Uwp.UI.Controls.csproj">
|
||||||
|
|||||||
Reference in New Issue
Block a user