42 lines
1004 B
C#
42 lines
1004 B
C#
using Avalonia.Controls;
|
|
using Avalonia.Markup.Xaml;
|
|
|
|
namespace Project_Periodensystem.View
|
|
{
|
|
public partial class MainWindow : Window
|
|
{
|
|
private readonly ContentControl mainContent;
|
|
|
|
public MainWindow()
|
|
{
|
|
InitializeComponent();
|
|
var content = this.Find<ContentControl>("MainContent");
|
|
if (content == null)
|
|
throw new System.Exception("MainContent control not found.");
|
|
|
|
mainContent = content;
|
|
ShowLanding(); // Show initial page
|
|
}
|
|
|
|
private void InitializeComponent()
|
|
{
|
|
AvaloniaXamlLoader.Load(this);
|
|
}
|
|
|
|
public void ShowLanding()
|
|
{
|
|
mainContent.Content = new LandingPage();
|
|
}
|
|
|
|
public void ShowPeriodicTable()
|
|
{
|
|
mainContent.Content = new PeriodicTablePage();
|
|
}
|
|
|
|
public void ShowAbout()
|
|
{
|
|
mainContent.Content = new AboutPage();
|
|
}
|
|
}
|
|
}
|