Skip to content

Commit

Permalink
Fix tray menu window theme bug
Browse files Browse the repository at this point in the history
Fix tray menu window theme bug
  • Loading branch information
Gaoyifei1011 committed Apr 28, 2023
1 parent 29416c9 commit 5ff46b7
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 21 deletions.
4 changes: 2 additions & 2 deletions GetStoreApp/GetStoreApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<EnableMsixTooling>false</EnableMsixTooling>
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
<FileAlignment>512</FileAlignment>
<FileVersion>1.5.427.0</FileVersion>
<FileVersion>1.5.428.0</FileVersion>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateTestArtifacts>True</GenerateTestArtifacts>
<HttpActivityPropagationSupport>false</HttpActivityPropagationSupport>
Expand Down Expand Up @@ -43,7 +43,7 @@
<TargetFramework>net7.0-windows10.0.22621.0</TargetFramework>
<TargetPlatformMinVersion>10.0.18362.0</TargetPlatformMinVersion>
<TrimMode>partial</TrimMode>
<Version>1.5.427.0</Version>
<Version>1.5.428.0</Version>
<UseWindowsForms>False</UseWindowsForms>
<UseWinUI>true</UseWinUI>
<UseWPF>False</UseWPF>
Expand Down
4 changes: 2 additions & 2 deletions GetStoreApp/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@
// 生成号
// 修订号
//
[assembly: AssemblyVersion("1.5.427.0")]
[assembly: AssemblyFileVersion("1.5.427.0")]
[assembly: AssemblyVersion("1.5.428.0")]
[assembly: AssemblyFileVersion("1.5.428.0")]
4 changes: 2 additions & 2 deletions GetStoreApp/Styles/NavigationView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,8 @@
<Grid
x:Name="ContentGrid"
Margin="0,45,0,0"
Background="{ThemeResource NavigationViewContentBackground}"
BorderBrush="{ThemeResource NavigationViewContentGridBorderBrush}"
Background="Transparent"
BorderBrush="Transparent"
BorderThickness="{ThemeResource NavigationViewContentGridBorderThickness}"
CornerRadius="{ThemeResource NavigationViewContentGridCornerRadius}">
<Grid.RowDefinitions>
Expand Down
12 changes: 2 additions & 10 deletions GetStoreApp/Styles/WindowChrome.xaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="WindowLightBrush" Color="#F0F3F9" />
<SolidColorBrush x:Key="WindowDarkBrush" Color="#141414" />
<AcrylicBrush
x:Key="MenuFlyoutWindowLightBrush"
FallbackColor="#F9F9F9"
TintColor="#FCFCFC"
TintOpacity="0.0" />
<AcrylicBrush
x:Key="MenuFlyoutWindowDarkBrush"
FallbackColor="#2C2C2C"
TintColor="#2C2C2C"
TintOpacity="0.15" />
<SolidColorBrush x:Key="MenuFlyoutLightBrush" Color="#F8F8F8" />
<SolidColorBrush x:Key="MenuFlyoutDarkBrush" Color="#353535" />
<SolidColorBrush x:Key="WindowSystemBackdropBrush" Color="Transparent" />

<Style x:Key="WindowChromeStyle" TargetType="ContentControl">
Expand Down
8 changes: 4 additions & 4 deletions GetStoreApp/ViewModels/Window/TrayMenuViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,20 +195,20 @@ private void SetWindowBackground()
{
if (Application.Current.RequestedTheme == ApplicationTheme.Light)
{
WindowBackground = ResourceDictionaryHelper.WindowChromeDict["MenuFlyoutWindowLightBrush"] as AcrylicBrush;
WindowBackground = ResourceDictionaryHelper.WindowChromeDict["MenuFlyoutLightBrush"] as SolidColorBrush;
}
else
{
WindowBackground = ResourceDictionaryHelper.WindowChromeDict["MenuFlyoutWindowDarkBrush"] as AcrylicBrush;
WindowBackground = ResourceDictionaryHelper.WindowChromeDict["MenuFlyoutDarkBrush"] as SolidColorBrush;
}
}
else if (WindowTheme == ElementTheme.Light)
{
WindowBackground = ResourceDictionaryHelper.WindowChromeDict["MenuFlyoutWindowLightBrush"] as AcrylicBrush;
WindowBackground = ResourceDictionaryHelper.WindowChromeDict["MenuFlyoutLightBrush"] as SolidColorBrush;
}
else if (WindowTheme == ElementTheme.Dark)
{
WindowBackground = ResourceDictionaryHelper.WindowChromeDict["MenuFlyoutWindowDarkBrush"] as AcrylicBrush;
WindowBackground = ResourceDictionaryHelper.WindowChromeDict["MenuFlyoutDarkBrush"] as SolidColorBrush;
}
}
else
Expand Down
2 changes: 1 addition & 1 deletion GetStoreAppPackage/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<Identity
Name="Gaoyifei1011.GetStoreApp"
Publisher="CN=高怡飞"
Version="1.5.427.0" />
Version="1.5.428.0" />

<Properties>
<DisplayName>ms-resource:PackageDisplayName</DisplayName>
Expand Down

0 comments on commit 5ff46b7

Please sign in to comment.