Daten werden nun geladen
This commit is contained in:
45
GuiWPF/MainWindowViewModel.cs
Normal file
45
GuiWPF/MainWindowViewModel.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace WPF
|
||||
{
|
||||
public class MainWindowViewModel : ViewModelBase
|
||||
{
|
||||
public ICommand LoadHomePageCommand { get; private set; }
|
||||
public ICommand LoadSettingsPageCommand { get; private set;}
|
||||
|
||||
private ViewModelBase _currentViewModel;
|
||||
public ViewModelBase CurrentViewModel
|
||||
{
|
||||
get => _currentViewModel;
|
||||
set
|
||||
{
|
||||
_currentViewModel = value;
|
||||
OnPropertyChanged("CurrentViewModel");
|
||||
}
|
||||
}
|
||||
|
||||
public MainWindowViewModel()
|
||||
{
|
||||
this.LoadHomePage();
|
||||
this.LoadHomePageCommand = new DelegateCommand(o => this.LoadHomePage());
|
||||
this.LoadSettingsPageCommand = new DelegateCommand(o => this.LoadSettingsPage());
|
||||
}
|
||||
|
||||
private void LoadHomePage()
|
||||
{
|
||||
CurrentViewModel = new HomePageViewModel(
|
||||
new HomePage { PageTitle = "This is the Home Page" });
|
||||
}
|
||||
|
||||
private void LoadSettingsPage()
|
||||
{
|
||||
CurrentViewModel = new SettingsPageViewModel(
|
||||
new SettingsPage() { PageTitle = "This is the SettingsPage" });
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user