Interktion im WPF erweitert
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user