46 lines
1.4 KiB
C#
46 lines
1.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
using System.Text;
|
|
using System.Windows.Input;
|
|
|
|
namespace GuiWPF
|
|
{
|
|
public class MainViewModel : ViewModelBase
|
|
{
|
|
public string PageTitle { get; set; }
|
|
public ICommand LoadHomePageCommand {get; private set;}
|
|
public ICommand LoadSettingsPageCommand {get; private set;}
|
|
|
|
private ViewModelBase _currentViewModel;
|
|
public ViewModelBase CurrentViewModel {
|
|
get {
|
|
Trace.WriteLine("CurrentAbgefragt");
|
|
return _currentViewModel;
|
|
}
|
|
set {
|
|
Trace.WriteLine("CurrentView ist geändert worden");
|
|
_currentViewModel = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
|
|
public MainViewModel()
|
|
{
|
|
PageTitle = "Dichtheitsprüfung by Damian";
|
|
LoadHomePage();
|
|
LoadHomePageCommand = new DelegateCommand(o => this.LoadHomePage());
|
|
LoadSettingsPageCommand = new DelegateCommand(o => this.LoadSettingsPage());
|
|
|
|
//Initialisieren();
|
|
}
|
|
|
|
private void LoadHomePage() {
|
|
CurrentViewModel = new HomePageViewModel(new HomePage() { PageTitle = "Home"});
|
|
}
|
|
private void LoadSettingsPage() {
|
|
CurrentViewModel = new SettingsPageViewModel();
|
|
}
|
|
}
|
|
}
|