committed
This commit is contained in:
45
GuiWPF/MainViewModel.cs
Normal file
45
GuiWPF/MainViewModel.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user