WIP dependency Injection

This commit is contained in:
HuskyTeufel
2021-09-13 15:37:23 +02:00
parent 70fcb1711d
commit 12652b3fa3
96 changed files with 4836 additions and 505 deletions

View File

@@ -0,0 +1,36 @@
using DaSaSo.Domain.Model;
using DaSaSo.Domain.Service;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DaSaSo.ViewModel
{
public class ClientEditViewModel : BaseViewModel
{
private Client _model;
private IDataService<Client> _dataService;
public Client Model { get => _model; set => _model = value; }
public IRelayCommand SaveClientCommand { get; set; }
public ClientEditViewModel(IDataService<Client> dataService, Client model)
{
this._model = model;
this._dataService = dataService;
SaveClientCommand = new RelayCommand(SaveClient);
}
private void SaveClient()
{
_dataService.Update(Model.Id, Model);
Mediator.Notify(Enums.EMediator.SHOWCLIENT);
}
}
}