Include WinUI reference

This commit is contained in:
Daniel Clark
2021-02-09 14:14:42 +00:00
parent fae7721b5f
commit d8581f33e7
7 changed files with 12 additions and 56 deletions
@@ -7,6 +7,9 @@
<LangVersion>9.0</LangVersion>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.UI.Xaml" Version="2.5.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NotificationFlyout.Uwp.UI.Controls\NotificationFlyout.Uwp.UI.Controls.csproj" />
@@ -2,7 +2,7 @@
x:Class="NotificationFlyout.Sample.Uwp.NotificationFlyoutPresenter"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:NotificationFlyout.Uwp.UI.Controls">
xmlns:winui="using:Microsoft.UI.Xaml.Controls">
<StackPanel
Width="330"
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>
+5 -1
View File
@@ -2,4 +2,8 @@
x:Class="NotificationFlyout.XamlHost.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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">
<Version>6.1.2</Version>
</PackageReference>
<PackageReference Include="Microsoft.UI.Xaml">
<Version>2.5.0-prerelease.201202003</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NotificationFlyout.Uwp.UI.Controls\NotificationFlyout.Uwp.UI.Controls.csproj">