Haltungübersicht angefangen

This commit is contained in:
2023-04-03 11:17:29 +02:00
parent d4b38ff7ae
commit 7999b7ffd0
33 changed files with 697 additions and 429 deletions

View File

@@ -16,35 +16,37 @@ namespace SewerStammGen.WPF.ViewModel
{
public class ManholeListViewModel : BaseViewModel
{
private ISchachtDataService _schachtService;
private ISchachtDataService _schachtDataService;
private readonly ObservableCollection<Schacht> _schaechte;
private readonly IActualState _actualState;
private readonly ISchachtService _schachtServicer;
private readonly ISchachtService _schachtService;
public ObservableCollection<Schacht> Schaechte { get => _schaechte; }
public Schacht? SelectedSchacht { get; set; }
public ICommand AddSchachtCommand { get; set; }
public ICommand EditSchachtCommand { get; set; }
public ICommand DeleteSchachtCommand { get; set; }
public ManholeListViewModel(ISchachtDataService schachtService, IDataService<Projekt> projektService,IRenavigator renavigator ,IActualState actualState, ISchachtService schachtServicer)
public ManholeListViewModel(ISchachtDataService schachtDataService, IDataService<Projekt> projektService,IRenavigator renavigator ,IActualState actualState, ISchachtService schachtService)
{
_schachtService = schachtService;
_schachtDataService = schachtDataService;
_actualState = actualState;
_schaechte = new ObservableCollection<Schacht>();
_schachtServicer = schachtServicer;
_schachtService = schachtService;
AddSchachtCommand = new SchachtAddCommand(schachtService,projektService, actualState,renavigator,schachtServicer);
EditSchachtCommand = new SchachtEditCommand(schachtService, actualState, renavigator,this);
DeleteSchachtCommand = new SchachtDeleteCommand(schachtService, actualState, renavigator, this);
AddSchachtCommand = new SchachtAddCommand(projektService, actualState,renavigator,schachtService);
EditSchachtCommand = new SchachtEditCommand(schachtDataService, actualState, renavigator,this);
DeleteSchachtCommand = new SchachtDeleteCommand(schachtDataService, actualState, renavigator, this);
LoadSchaechte();
}
private async void LoadSchaechte()
{
var schaechte = await _schachtService.GetAll(_actualState.ProjektID);
var schaechte = await _schachtDataService.GetAll(_actualState.ProjektID);
InitCollection(_schaechte, schaechte);
}