From 11dccc04cbd5654ee342159e2cc4acb7709f159f Mon Sep 17 00:00:00 2001 From: OliverT87 Date: Tue, 27 May 2025 14:24:46 +0200 Subject: [PATCH] =?UTF-8?q?ok,=20Fenster=20ist=20da,=20ich=20komme=20auf?= =?UTF-8?q?=20die=20main=20und=20auf=20die=20about=20page=20und=20auch=20v?= =?UTF-8?q?on=20da=20zur=C3=BCck=20zur=20main;=20Inhalt=20main=20page=20fe?= =?UTF-8?q?hlt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Project_Periodensystem.Controller.csproj | 2 +- .../Project_Periodensystem.Model.csproj | 2 +- .../Project_Periodensystem.Persistence.csproj | 2 +- Project_Periodensystem.View/AboutPage.axaml | 12 +++++ .../AboutPage.axaml.cs | 27 +++++++++++ Project_Periodensystem.View/App.axaml | 3 +- Project_Periodensystem.View/App.axaml.cs | 6 ++- Project_Periodensystem.View/LandingPage.axaml | 22 +++++++++ .../LandingPage.axaml.cs | 29 ++++++++++++ Project_Periodensystem.View/MainWindow.axaml | 22 ++------- .../MainWindow.axaml.cs | 45 +++++++++---------- .../PeriodicTablePage.axaml | 11 +++++ .../PeriodicTablePage.axaml.cs | 29 ++++++++++++ Project_Periodensystem.View/Program.cs | 17 +++---- .../Project_Periodensystem.View.csproj | 27 +++++------ program.cs | 0 16 files changed, 182 insertions(+), 74 deletions(-) create mode 100644 Project_Periodensystem.View/AboutPage.axaml create mode 100644 Project_Periodensystem.View/AboutPage.axaml.cs create mode 100644 Project_Periodensystem.View/LandingPage.axaml create mode 100644 Project_Periodensystem.View/LandingPage.axaml.cs create mode 100644 Project_Periodensystem.View/PeriodicTablePage.axaml create mode 100644 Project_Periodensystem.View/PeriodicTablePage.axaml.cs delete mode 100644 program.cs diff --git a/Project_Periodensystem.Controller/Project_Periodensystem.Controller.csproj b/Project_Periodensystem.Controller/Project_Periodensystem.Controller.csproj index b66d3a2..566ae43 100644 --- a/Project_Periodensystem.Controller/Project_Periodensystem.Controller.csproj +++ b/Project_Periodensystem.Controller/Project_Periodensystem.Controller.csproj @@ -6,7 +6,7 @@ - net9.0 + net8.0 enable enable diff --git a/Project_Periodensystem.Model/Project_Periodensystem.Model.csproj b/Project_Periodensystem.Model/Project_Periodensystem.Model.csproj index 125f4c9..fa71b7a 100644 --- a/Project_Periodensystem.Model/Project_Periodensystem.Model.csproj +++ b/Project_Periodensystem.Model/Project_Periodensystem.Model.csproj @@ -1,7 +1,7 @@  - net9.0 + net8.0 enable enable diff --git a/Project_Periodensystem.Persistence/Project_Periodensystem.Persistence.csproj b/Project_Periodensystem.Persistence/Project_Periodensystem.Persistence.csproj index d11543f..631b156 100644 --- a/Project_Periodensystem.Persistence/Project_Periodensystem.Persistence.csproj +++ b/Project_Periodensystem.Persistence/Project_Periodensystem.Persistence.csproj @@ -2,7 +2,7 @@ - net9.0 + net8.0 enable diff --git a/Project_Periodensystem.View/AboutPage.axaml b/Project_Periodensystem.View/AboutPage.axaml new file mode 100644 index 0000000..73c9f0a --- /dev/null +++ b/Project_Periodensystem.View/AboutPage.axaml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/Project_Periodensystem.View/AboutPage.axaml.cs b/Project_Periodensystem.View/AboutPage.axaml.cs new file mode 100644 index 0000000..5ae8acc --- /dev/null +++ b/Project_Periodensystem.View/AboutPage.axaml.cs @@ -0,0 +1,27 @@ +using Avalonia.Controls; +using Avalonia.Interactivity; +using Avalonia.Markup.Xaml; +using Avalonia.VisualTree; + +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) + { + var window = this.GetVisualRoot() as MainWindow; + if (window != null) + { + window.ShowLanding(); + } + } + } +} diff --git a/Project_Periodensystem.View/App.axaml b/Project_Periodensystem.View/App.axaml index 2020807..09e0eda 100644 --- a/Project_Periodensystem.View/App.axaml +++ b/Project_Periodensystem.View/App.axaml @@ -1,7 +1,6 @@ + x:Class="Project_Periodensystem.View.App"> diff --git a/Project_Periodensystem.View/App.axaml.cs b/Project_Periodensystem.View/App.axaml.cs index c31d742..1b535e1 100644 --- a/Project_Periodensystem.View/App.axaml.cs +++ b/Project_Periodensystem.View/App.axaml.cs @@ -7,12 +7,16 @@ namespace Project_Periodensystem.View public partial class App : Application { public override void Initialize() - => AvaloniaXamlLoader.Load(this); + { + AvaloniaXamlLoader.Load(this); + } public override void OnFrameworkInitializationCompleted() { if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) + { desktop.MainWindow = new MainWindow(); + } base.OnFrameworkInitializationCompleted(); } diff --git a/Project_Periodensystem.View/LandingPage.axaml b/Project_Periodensystem.View/LandingPage.axaml new file mode 100644 index 0000000..8de217f --- /dev/null +++ b/Project_Periodensystem.View/LandingPage.axaml @@ -0,0 +1,22 @@ + + + + + + \ No newline at end of file diff --git a/Project_Periodensystem.View/PeriodicTablePage.axaml.cs b/Project_Periodensystem.View/PeriodicTablePage.axaml.cs new file mode 100644 index 0000000..54a3d89 --- /dev/null +++ b/Project_Periodensystem.View/PeriodicTablePage.axaml.cs @@ -0,0 +1,29 @@ +using Avalonia.Controls; +using Avalonia.Interactivity; +using Avalonia.Markup.Xaml; +using Avalonia.VisualTree; + +namespace Project_Periodensystem.View +{ + public partial class PeriodicTablePage : UserControl + { + public PeriodicTablePage() + { + InitializeComponent(); + } + + private void InitializeComponent() + { + AvaloniaXamlLoader.Load(this); + } + + private void AboutButton_Click(object sender, RoutedEventArgs e) + { + var window = this.GetVisualRoot() as MainWindow; + if (window != null) + { + window.ShowAbout(); + } + } + } +} diff --git a/Project_Periodensystem.View/Program.cs b/Project_Periodensystem.View/Program.cs index 3887d6b..47d1bb8 100644 --- a/Project_Periodensystem.View/Program.cs +++ b/Project_Periodensystem.View/Program.cs @@ -1,18 +1,19 @@ -using System; -using Avalonia; +using Avalonia; namespace Project_Periodensystem.View { - class Program + internal static class Program { - [STAThread] + [System.STAThread] // <-- Das ist korrekt! public static void Main(string[] args) - => BuildAvaloniaApp() - .StartWithClassicDesktopLifetime(args); + { + BuildAvaloniaApp() + .StartWithClassicDesktopLifetime(args); + } public static AppBuilder BuildAvaloniaApp() => AppBuilder.Configure() - .UsePlatformDetect() - .LogToTrace(); + .UsePlatformDetect() + .LogToTrace(); } } diff --git a/Project_Periodensystem.View/Project_Periodensystem.View.csproj b/Project_Periodensystem.View/Project_Periodensystem.View.csproj index 39e1e1a..0dab29c 100644 --- a/Project_Periodensystem.View/Project_Periodensystem.View.csproj +++ b/Project_Periodensystem.View/Project_Periodensystem.View.csproj @@ -1,32 +1,25 @@  + net8.0 WinExe - net9.0 enable - true - app.manifest - - - true - - - false + false + false - - - - - - None - All - + + + + + + + diff --git a/program.cs b/program.cs deleted file mode 100644 index e69de29..0000000