46 lines
1.2 KiB
C#
46 lines
1.2 KiB
C#
using System;
|
|
using Avalonia.Controls;
|
|
using Avalonia.Interactivity;
|
|
using Avalonia.Markup.Xaml;
|
|
using Avalonia.VisualTree;
|
|
using Project_Periodensystem.Model;
|
|
|
|
namespace Project_Periodensystem.View
|
|
{
|
|
public partial class AboutPage : UserControl
|
|
{
|
|
public AboutPage()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void InitializeComponent()
|
|
{
|
|
AvaloniaXamlLoader.Load(this);
|
|
}
|
|
|
|
private void BackButton_Click(object? sender, RoutedEventArgs e)
|
|
{
|
|
if (this.Parent is ContentControl content && content.Parent is MainWindow mainWindow)
|
|
{
|
|
mainWindow.ShowLandingPage();
|
|
}
|
|
}
|
|
|
|
private void ThemeButton_Click(object? sender, RoutedEventArgs e)
|
|
{
|
|
var nextTheme = MainWindow.CurrentTheme switch
|
|
{
|
|
AppTheme.Dark => AppTheme.Light,
|
|
AppTheme.Light => AppTheme.Classic,
|
|
_ => AppTheme.Dark
|
|
};
|
|
|
|
if (this.Parent is ContentControl content && content.Parent is MainWindow mainWindow)
|
|
{
|
|
mainWindow.UpdateTheme(nextTheme);
|
|
}
|
|
}
|
|
}
|
|
}
|