From 2f4cd2e44383bc432c5eba96f2fdc175a02c023b Mon Sep 17 00:00:00 2001 From: ysmoradi Date: Mon, 12 Aug 2024 13:33:05 +0200 Subject: [PATCH] fix --- .../Client/Boilerplate.Client.Core/Styles/ThemeColors.cs | 4 ++-- .../src/Client/Boilerplate.Client.Core/Styles/app.scss | 2 +- .../src/Client/Boilerplate.Client.Maui/MainPage.xaml | 8 ++++---- .../src/Client/Boilerplate.Client.Maui/MauiProgram.cs | 2 +- .../Services/MauiDeviceCoordinator.cs | 2 +- .../src/Client/Boilerplate.Client.Windows/App.xaml | 2 +- .../src/Client/Boilerplate.Client.Windows/App.xaml.cs | 2 +- .../src/Client/Boilerplate.Client.Windows/MainWindow.xaml | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Styles/ThemeColors.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Styles/ThemeColors.cs index 2055946426..982f092730 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Styles/ThemeColors.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Styles/ThemeColors.cs @@ -2,7 +2,7 @@ public class ThemeColors { - public static readonly string BackgroundColorPrimaryDark = "#000000"; - public static readonly string BackgroundColorPrimaryLight = "#FFFFFF"; + public static readonly string PrimaryDarkBgColor = "#000000"; + public static readonly string PrimaryLightBgColor = "#FFFFFF"; // In case you need to change the background color, make sure to also update app.scss's --bit-clr-bg-pri accordingly. } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Styles/app.scss b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Styles/app.scss index c00b2c09c1..eb84cab246 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Styles/app.scss +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Styles/app.scss @@ -4,7 +4,7 @@ :root[bit-theme="dark"] { --bit-clr-bg-pri: #000000; - // In case you need to change the background color, make sure to also update ThemeColors.cs's BackgroundColorPrimaryDark accordingly. + // In case you need to change the background color, make sure to also update ThemeColors.cs's PrimaryDarkBgColor accordingly. } * { diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/MainPage.xaml b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/MainPage.xaml index 15e196d559..982b7b6bdc 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/MainPage.xaml +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/MainPage.xaml @@ -5,12 +5,12 @@ xmlns:b="clr-namespace:Microsoft.AspNetCore.Components.WebView.Maui;assembly=Microsoft.AspNetCore.Components.WebView.Maui" xmlns:core="clr-namespace:Boilerplate.Client.Core;assembly=Boilerplate.Client.Core" xmlns:themeColors="clr-namespace:Boilerplate.Client.Core.Styles;assembly=Boilerplate.Client.Core" - BackgroundColor="{AppThemeBinding Light={x:Static themeColors:ThemeColors.BackgroundColorPrimaryLight}, - Dark={x:Static themeColors:ThemeColors.BackgroundColorPrimaryDark}}"> + BackgroundColor="{AppThemeBinding Light={x:Static themeColors:ThemeColors.PrimaryLightBgColor}, + Dark={x:Static themeColors:ThemeColors.PrimaryBgColorDark}}"> diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/MauiProgram.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/MauiProgram.cs index 3906ce813f..4ae4dd3a96 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/MauiProgram.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/MauiProgram.cs @@ -97,7 +97,7 @@ private static void SetupBlazorWebView() { var webView = handler.PlatformView; var webViewBackgroundColor = AppInfo.Current.RequestedTheme == AppTheme.Dark ? - ThemeColors.BackgroundColorPrimaryDark : ThemeColors.BackgroundColorPrimaryLight; + ThemeColors.PrimaryDarkBgColor : ThemeColors.PrimaryLightBgColor; #if Windows webView.DefaultBackgroundColor = Color.FromArgb(webViewBackgroundColor).ToWindowsColor(); diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Services/MauiDeviceCoordinator.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Services/MauiDeviceCoordinator.cs index 91ac2aa8ee..76d97f865f 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Services/MauiDeviceCoordinator.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Services/MauiDeviceCoordinator.cs @@ -38,7 +38,7 @@ public async Task ApplyTheme(bool isDark) window!.DecorView!.SystemUiFlags &= ~Android.Views.SystemUiFlags.LightStatusBar; } - window.SetStatusBarColor(Android.Graphics.Color.ParseColor(isDark ? ThemeColors.BackgroundColorPrimaryDark : ThemeColors.BackgroundColorPrimaryLight)); + window.SetStatusBarColor(Android.Graphics.Color.ParseColor(isDark ? ThemeColors.PrimaryDarkBgColor : ThemeColors.PrimaryLightBgColor)); #elif IOS var statusBarStyle = isDark ? UIKit.UIStatusBarStyle.LightContent : UIKit.UIStatusBarStyle.DarkContent; await Device.InvokeOnMainThreadAsync(() => diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/App.xaml b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/App.xaml index dc9d70d8ba..0718cfd462 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/App.xaml +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/App.xaml @@ -8,7 +8,7 @@ StartupUri="MainWindow.xaml"> - #0D2960 + #0D2960 diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/App.xaml.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/App.xaml.cs index c0811a76cc..184f10ccd6 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/App.xaml.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/App.xaml.cs @@ -18,7 +18,7 @@ public App() var splash = new SplashScreen(typeof(App).Assembly, @"Resources\SplashScreen.png"); splash.Show(autoClose: true, topMost: true); - Resources["BackgroundColorPrimary"] = new BrushConverter().ConvertFrom(IsDarkTheme() ? ThemeColors.BackgroundColorPrimaryDark : ThemeColors.BackgroundColorPrimaryLight); + Resources["PrimaryBgColor"] = new BrushConverter().ConvertFrom(IsDarkTheme() ? ThemeColors.PrimaryDarkBgColor : ThemeColors.PrimaryLightBgColor); } private static bool IsDarkTheme() diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/MainWindow.xaml b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/MainWindow.xaml index 34b75c19c9..e8438e3504 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/MainWindow.xaml +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/MainWindow.xaml @@ -7,7 +7,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Title="Boilerplate" - Background="{DynamicResource BackgroundColorPrimary}" + Background="{DynamicResource PrimaryBgColor}" WindowState="Maximized" mc:Ignorable="d">