104 lines
2.5 KiB
C#
104 lines
2.5 KiB
C#
using DaSaSo.Domain.Model;
|
|
using DaSaSo.EntityFramework;
|
|
using DaSaSo.EntityFramework.Services;
|
|
using DaSaSo.ViewModel.Enums;
|
|
using DaSaSo.ViewModel.Interface;
|
|
using DaSaSo.ViewModel.State.Navigation;
|
|
using Microsoft.Toolkit.Mvvm.Input;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Input;
|
|
|
|
namespace DaSaSo.ViewModel
|
|
{
|
|
public sealed class MainWindowViewModel : BaseViewModel
|
|
{
|
|
|
|
private Client _selectedClient;
|
|
private Project _selectedProject;
|
|
private Buildingsite _selectedBuildingsite;
|
|
|
|
public INavigator Navigator { get; set; }
|
|
|
|
public Project SelectedProject
|
|
{
|
|
get => _selectedProject;
|
|
set
|
|
{
|
|
if(_selectedProject != value)
|
|
{
|
|
_selectedProject = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
}
|
|
public Buildingsite SelectedBuildingsite
|
|
{
|
|
get => _selectedBuildingsite;
|
|
set
|
|
{
|
|
if(_selectedBuildingsite != value)
|
|
{
|
|
_selectedBuildingsite = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
}
|
|
|
|
public Client SelectedClient
|
|
{
|
|
get => _selectedClient;
|
|
set
|
|
{
|
|
if(_selectedClient != value)
|
|
{
|
|
_selectedClient = value;
|
|
//SelectedProject = null;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
}
|
|
public MainWindowViewModel(INavigator navigator)
|
|
{
|
|
this.Navigator = navigator;
|
|
Navigator.UpdateViewModelCommand.Execute(EViewType.Home);
|
|
|
|
|
|
Mediator.Subscribe(Enums.EMediator.SELECTEDCLIENT, (tt) =>
|
|
{
|
|
SelectedClient = (Client)tt;
|
|
listProjecte();
|
|
});
|
|
|
|
Mediator.Subscribe(Enums.EMediator.EDITCLIENT, (tt) =>
|
|
{
|
|
|
|
});
|
|
Mediator.Subscribe(Enums.EMediator.SHOWCLIENT, (tt) => {
|
|
|
|
});
|
|
}
|
|
|
|
|
|
|
|
private void listSewerObjects()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
private void listBuildingsite()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
private void listProjecte()
|
|
{
|
|
|
|
}
|
|
}
|
|
}
|