using Avalonia;
using Avalonia.Controls;
using Project_Periodensystem.Model;
namespace Project_Periodensystem.View
{
///
/// Vereinfachtes MainWindow - nur noch Container für Content
///
public partial class MainWindow : Window
{
private ContentControl? mainContent;
public MainWindow()
{
InitializeComponent();
mainContent = this.FindControl("MainContent");
ShowLandingPage();
}
///
/// Zeigt die Landing Page an
///
public void ShowLandingPage()
{
if (mainContent != null)
{
mainContent.Content = new LandingPage();
Logger.Log("Landing Page angezeigt");
}
}
///
/// Zeigt das Periodensystem an
///
public void ShowPeriodicTable()
{
Logger.Log("ShowPeriodicTable called");
try
{
if (mainContent != null)
{
mainContent.Content = new PeriodicTablePage();
Logger.Log("PeriodicTablePage created and set");
}
}
catch (System.Exception ex)
{
Logger.Log($"Error in ShowPeriodicTable: {ex.Message}");
}
}
///
/// Zeigt die About Page an
///
public void ShowAboutPage()
{
if (mainContent != null)
{
mainContent.Content = new AboutPage();
Logger.Log("About Page angezeigt");
}
}
}
}