Navigation zwischen views Funktioniert
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using DaSaSo.Domain.Model;
|
||||
using DaSaSo.Domain.Services;
|
||||
using DaSaSo.ViewModel.Commands;
|
||||
using DaSaSo.ViewModel.Enums;
|
||||
using DaSaSo.ViewModel.Interface;
|
||||
using Microsoft.Toolkit.Mvvm.Input;
|
||||
using System;
|
||||
@@ -19,11 +20,12 @@ namespace DaSaSo.ViewModel
|
||||
public ObservableCollection<Client> Clients { get; }
|
||||
private Client? _selectedClient;
|
||||
private IDataService<Client> _dataService;
|
||||
private readonly IRenavigator renavigator;
|
||||
IEnumerable<Client>? result;
|
||||
bool _isLoading = true;
|
||||
|
||||
public ICommand SelectCommand { get; set; }
|
||||
public IRelayCommand EditClientCommand { get; set; }
|
||||
public ICommand EditCommand { get; set; }
|
||||
public IRelayCommand AddNewClientCommand { get; set; }
|
||||
|
||||
public Client SelectedClient
|
||||
@@ -54,17 +56,23 @@ namespace DaSaSo.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
public ClientListViewModel(IDataService<Client> dataService, IActualProject actualProject)
|
||||
public ClientListViewModel(IDataService<Client> dataService, IActualProject actualProject, IRenavigator renavigator)
|
||||
{
|
||||
Clients = new ObservableCollection<Client>();
|
||||
_dataService = dataService;
|
||||
|
||||
|
||||
this.renavigator = renavigator;
|
||||
LoadClient();
|
||||
SelectCommand = new SelectClientCommand(actualProject,this); //= new RelayCommand(SelectClient, () => SelectedClient != null);
|
||||
SelectCommand = new SelectClientCommand(actualProject, this); //= new RelayCommand(SelectClient, () => SelectedClient != null);
|
||||
EditCommand = new EditClientCommand(actualProject,renavigator,this);
|
||||
//EditClientCommand = new RelayCommand(EditClient, () => SelectedClient != null);
|
||||
//AddNewClientCommand = new RelayCommand(AddNewClient);
|
||||
|
||||
}
|
||||
|
||||
private void edit()
|
||||
{
|
||||
|
||||
//_navigator.UpdateViewModelCommand.Execute(EViewType.ClientEdit);
|
||||
}
|
||||
|
||||
private async Task<Client> insertNewClient()
|
||||
|
||||
Reference in New Issue
Block a user