Client wird gespeichert mittels interface
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
using DaSaSo.Domain.Model;
|
||||
using DaSaSo.Domain.Services;
|
||||
using DaSaSo.ViewModel.Commands;
|
||||
using DaSaSo.ViewModel.Interface;
|
||||
using Microsoft.Toolkit.Mvvm.Input;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -20,7 +22,7 @@ namespace DaSaSo.ViewModel
|
||||
IEnumerable<Client>? result;
|
||||
bool _isLoading = true;
|
||||
|
||||
public IRelayCommand SelectClientCommand { get; set; }
|
||||
public ICommand SelectCommand { get; set; }
|
||||
public IRelayCommand EditClientCommand { get; set; }
|
||||
public IRelayCommand AddNewClientCommand { get; set; }
|
||||
|
||||
@@ -32,8 +34,8 @@ namespace DaSaSo.ViewModel
|
||||
if(_selectedClient != value)
|
||||
{
|
||||
_selectedClient = value;
|
||||
SelectClientCommand.NotifyCanExecuteChanged();
|
||||
EditClientCommand.NotifyCanExecuteChanged();
|
||||
//SelectClientCommand.NotifyCanExecuteChanged();
|
||||
//EditClientCommand.NotifyCanExecuteChanged();
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
@@ -52,16 +54,16 @@ namespace DaSaSo.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
public ClientListViewModel(IDataService<Client> dataService)
|
||||
public ClientListViewModel(IDataService<Client> dataService, IActualProject actualProject)
|
||||
{
|
||||
Clients = new ObservableCollection<Client>();
|
||||
_dataService = dataService;
|
||||
|
||||
|
||||
LoadClient();
|
||||
SelectClientCommand = new RelayCommand(SelectClient, () => SelectedClient != null);
|
||||
EditClientCommand = new RelayCommand(EditClient, () => SelectedClient != null);
|
||||
AddNewClientCommand = new RelayCommand(AddNewClient);
|
||||
SelectCommand = new SelectClientCommand(actualProject,this); //= new RelayCommand(SelectClient, () => SelectedClient != null);
|
||||
//EditClientCommand = new RelayCommand(EditClient, () => SelectedClient != null);
|
||||
//AddNewClientCommand = new RelayCommand(AddNewClient);
|
||||
|
||||
}
|
||||
|
||||
@@ -93,6 +95,7 @@ namespace DaSaSo.ViewModel
|
||||
|
||||
private void SelectClient()
|
||||
{
|
||||
|
||||
Mediator.Notify(Enums.EMediator.SELECTEDCLIENT, SelectedClient);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user