Files
MainSoftware/GuiWPF/MainViewModel.cs
HuskyTeufel af01e537cf committed
2021-05-05 13:06:56 +02:00

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();
}
}
}