committed

This commit is contained in:
HuskyTeufel
2021-05-05 13:06:56 +02:00
parent 2c4bcde9c8
commit af01e537cf
17 changed files with 234 additions and 38 deletions

45
GuiWPF/MainViewModel.cs Normal file
View File

@@ -0,0 +1,45 @@
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();
}
}
}