Interktion im WPF erweitert

This commit is contained in:
HuskyTeufel
2021-09-22 16:26:56 +02:00
parent efa52c117c
commit e23f898f14
48 changed files with 1946 additions and 88 deletions

View File

@@ -26,7 +26,7 @@ namespace DaSaSo.ViewModel
public ICommand SelectCommand { get; set; }
public ICommand EditCommand { get; set; }
public IRelayCommand AddNewClientCommand { get; set; }
public ICommand AddNewClientCommand { get; set; }
public Client SelectedClient
{
@@ -64,48 +64,10 @@ namespace DaSaSo.ViewModel
LoadClient();
SelectCommand = new SelectClientCommand(actualProject, this); //= new RelayCommand(SelectClient, () => SelectedClient != null);
EditCommand = new EditClientCommand(_dataService,actualProject,renavigator,this);
//EditClientCommand = new RelayCommand(EditClient, () => SelectedClient != null);
//AddNewClientCommand = new RelayCommand(AddNewClient);
AddNewClientCommand = new AddClientCommand(_dataService, actualProject, renavigator, this);
}
private void edit()
{
//_navigator.UpdateViewModelCommand.Execute(EViewType.ClientEdit);
}
private async Task<Client> insertNewClient()
{
Client newClient = new Client()
{
Firstname = "",
LastName = "",
Country = "",
Postcode = ""
};
await _dataService.Create(newClient);
return newClient;
}
private async void AddNewClient()
{
var d = insertNewClient();
await d;
Mediator.Notify(Enums.EMediator.EDITCLIENT, d);
}
private void EditClient()
{
Mediator.Notify(Enums.EMediator.EDITCLIENT, SelectedClient);
}
private void SelectClient()
{
Mediator.Notify(Enums.EMediator.SELECTEDCLIENT, SelectedClient);
}
public async void LoadClient()
{