Resolved Bug with CardReader only working once Resolved Bug with Message "Card does not exist", even if it exists
177 lines
9.8 KiB
C#
177 lines
9.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Media.Imaging;
|
|
|
|
namespace ZKuP
|
|
{
|
|
internal class ThemeManager
|
|
{
|
|
MainWindow main = MainWindow.main;
|
|
|
|
internal void ChangeAccent(string Color)
|
|
{
|
|
Color = Color == null || Color == "" ? "Blue" : Color;
|
|
string DarkLight = Settings.GetSettingBool("DarkMode") ? "Dark" : "Light";
|
|
|
|
ControlzEx.Theming.ThemeManager.Current.ChangeTheme(System.Windows.Application.Current, $"{DarkLight}.{Color}");
|
|
}
|
|
|
|
|
|
internal bool dark = false;
|
|
internal void ChangeTheme()
|
|
{
|
|
if (!dark)
|
|
{
|
|
ControlzEx.Theming.ThemeManager.Current.ChangeTheme(System.Windows.Application.Current, "Dark.Blue");
|
|
main.imgDarkModeButton.Source = new BitmapImage(new Uri(@"pack://application:,,,/"
|
|
+ System.Reflection.Assembly.GetExecutingAssembly().GetName().Name
|
|
+ ";component/"
|
|
+ $"Resources/Sun.png", UriKind.Absolute));
|
|
|
|
main.imgLKWLang.Source = new BitmapImage(new Uri(@"pack://application:,,,/"
|
|
+ System.Reflection.Assembly.GetExecutingAssembly().GetName().Name
|
|
+ ";component/"
|
|
+ $"Resources/LKWLang_dark.png", UriKind.Absolute));
|
|
main.imgLKW.Source = new BitmapImage(new Uri(@"pack://application:,,,/"
|
|
+ System.Reflection.Assembly.GetExecutingAssembly().GetName().Name
|
|
+ ";component/"
|
|
+ $"Resources/LKW_dark.png", UriKind.Absolute));
|
|
main.imgSprinter.Source = new BitmapImage(new Uri(@"pack://application:,,,/"
|
|
+ System.Reflection.Assembly.GetExecutingAssembly().GetName().Name
|
|
+ ";component/"
|
|
+ $"Resources/Sprinter_dark.png", UriKind.Absolute));
|
|
main.imgPKW.Source = new BitmapImage(new Uri(@"pack://application:,,,/"
|
|
+ System.Reflection.Assembly.GetExecutingAssembly().GetName().Name
|
|
+ ";component/"
|
|
+ $"Resources/PKW_dark.png", UriKind.Absolute));
|
|
main.imgBike.Source = new BitmapImage(new Uri(@"pack://application:,,,/"
|
|
+ System.Reflection.Assembly.GetExecutingAssembly().GetName().Name
|
|
+ ";component/"
|
|
+ $"Resources/Bike_dark.png", UriKind.Absolute));
|
|
|
|
dark = true;
|
|
Settings.WriteSetting("DarkMode", true);
|
|
//Properties.Settings.Default.DarkMode = true;
|
|
}
|
|
else
|
|
{
|
|
ControlzEx.Theming.ThemeManager.Current.ChangeTheme(System.Windows.Application.Current, "Light.Blue");
|
|
main.imgDarkModeButton.Source = new BitmapImage(new Uri(@"pack://application:,,,/"
|
|
+ System.Reflection.Assembly.GetExecutingAssembly().GetName().Name
|
|
+ ";component/"
|
|
+ $"Resources/Moon.png", UriKind.Absolute));
|
|
|
|
main.imgLKWLang.Source = new BitmapImage(new Uri(@"pack://application:,,,/"
|
|
+ System.Reflection.Assembly.GetExecutingAssembly().GetName().Name
|
|
+ ";component/"
|
|
+ $"Resources/LKWLang.png", UriKind.Absolute));
|
|
main.imgLKW.Source = new BitmapImage(new Uri(@"pack://application:,,,/"
|
|
+ System.Reflection.Assembly.GetExecutingAssembly().GetName().Name
|
|
+ ";component/"
|
|
+ $"Resources/LKW.png", UriKind.Absolute));
|
|
main.imgSprinter.Source = new BitmapImage(new Uri(@"pack://application:,,,/"
|
|
+ System.Reflection.Assembly.GetExecutingAssembly().GetName().Name
|
|
+ ";component/"
|
|
+ $"Resources/Sprinter.png", UriKind.Absolute));
|
|
main.imgPKW.Source = new BitmapImage(new Uri(@"pack://application:,,,/"
|
|
+ System.Reflection.Assembly.GetExecutingAssembly().GetName().Name
|
|
+ ";component/"
|
|
+ $"Resources/PKW.png", UriKind.Absolute));
|
|
main.imgBike.Source = new BitmapImage(new Uri(@"pack://application:,,,/"
|
|
+ System.Reflection.Assembly.GetExecutingAssembly().GetName().Name
|
|
+ ";component/"
|
|
+ $"Resources/Bike.png", UriKind.Absolute));
|
|
|
|
|
|
dark = false;
|
|
Settings.WriteSetting("DarkMode", false);
|
|
//Properties.Settings.Default.DarkMode = false;
|
|
}
|
|
|
|
main.getFahrzeuge();
|
|
main.getBikes();
|
|
}
|
|
|
|
internal void ChangeTheme(bool darkSet)
|
|
{
|
|
if (darkSet)
|
|
{
|
|
ControlzEx.Theming.ThemeManager.Current.ChangeTheme(System.Windows.Application.Current, "Dark.Blue");
|
|
main.imgDarkModeButton.Source = new BitmapImage(new Uri(@"pack://application:,,,/"
|
|
+ System.Reflection.Assembly.GetExecutingAssembly().GetName().Name
|
|
+ ";component/"
|
|
+ $"Resources/Sun.png", UriKind.Absolute));
|
|
|
|
|
|
main.imgLKWLang.Source = new BitmapImage(new Uri(@"pack://application:,,,/"
|
|
+ System.Reflection.Assembly.GetExecutingAssembly().GetName().Name
|
|
+ ";component/"
|
|
+ $"Resources/LKWLang_dark.png", UriKind.Absolute));
|
|
main.imgLKW.Source = new BitmapImage(new Uri(@"pack://application:,,,/"
|
|
+ System.Reflection.Assembly.GetExecutingAssembly().GetName().Name
|
|
+ ";component/"
|
|
+ $"Resources/LKW_dark.png", UriKind.Absolute));
|
|
main.imgSprinter.Source = new BitmapImage(new Uri(@"pack://application:,,,/"
|
|
+ System.Reflection.Assembly.GetExecutingAssembly().GetName().Name
|
|
+ ";component/"
|
|
+ $"Resources/Sprinter_dark.png", UriKind.Absolute));
|
|
main.imgPKW.Source = new BitmapImage(new Uri(@"pack://application:,,,/"
|
|
+ System.Reflection.Assembly.GetExecutingAssembly().GetName().Name
|
|
+ ";component/"
|
|
+ $"Resources/PKW_dark.png", UriKind.Absolute));
|
|
main.imgBike.Source = new BitmapImage(new Uri(@"pack://application:,,,/"
|
|
+ System.Reflection.Assembly.GetExecutingAssembly().GetName().Name
|
|
+ ";component/"
|
|
+ $"Resources/Bike_dark.png", UriKind.Absolute));
|
|
|
|
|
|
dark = true;
|
|
Settings.WriteSetting("DarkMode", true);
|
|
//Properties.Settings.Default.DarkMode = true;
|
|
}
|
|
else
|
|
{
|
|
ControlzEx.Theming.ThemeManager.Current.ChangeTheme(System.Windows.Application.Current, "Light.Blue");
|
|
main.imgDarkModeButton.Source = new BitmapImage(new Uri(@"pack://application:,,,/"
|
|
+ System.Reflection.Assembly.GetExecutingAssembly().GetName().Name
|
|
+ ";component/"
|
|
+ $"Resources/Moon.png", UriKind.Absolute));
|
|
|
|
main.imgLKWLang.Source = new BitmapImage(new Uri(@"pack://application:,,,/"
|
|
+ System.Reflection.Assembly.GetExecutingAssembly().GetName().Name
|
|
+ ";component/"
|
|
+ $"Resources/LKWLang.png", UriKind.Absolute));
|
|
main.imgLKW.Source = new BitmapImage(new Uri(@"pack://application:,,,/"
|
|
+ System.Reflection.Assembly.GetExecutingAssembly().GetName().Name
|
|
+ ";component/"
|
|
+ $"Resources/LKW.png", UriKind.Absolute));
|
|
main.imgSprinter.Source = new BitmapImage(new Uri(@"pack://application:,,,/"
|
|
+ System.Reflection.Assembly.GetExecutingAssembly().GetName().Name
|
|
+ ";component/"
|
|
+ $"Resources/Sprinter.png", UriKind.Absolute));
|
|
main.imgPKW.Source = new BitmapImage(new Uri(@"pack://application:,,,/"
|
|
+ System.Reflection.Assembly.GetExecutingAssembly().GetName().Name
|
|
+ ";component/"
|
|
+ $"Resources/PKW.png", UriKind.Absolute));
|
|
main.imgBike.Source = new BitmapImage(new Uri(@"pack://application:,,,/"
|
|
+ System.Reflection.Assembly.GetExecutingAssembly().GetName().Name
|
|
+ ";component/"
|
|
+ $"Resources/Bike.png", UriKind.Absolute));
|
|
|
|
dark = false;
|
|
Settings.WriteSetting("DarkMode", false);
|
|
//Properties.Settings.Default.DarkMode = false;
|
|
}
|
|
|
|
main.getFahrzeuge();
|
|
main.getBikes();
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|