pschelpdesk/FastBill/ViewModels/CustomerViewModel.cs
2024-11-18 19:53:49 +01:00

32 lines
775 B
C#

using System.Reactive;
using FastBill.Services;
using PSCHelpdesk.Shared.ViewModels;
using ReactiveUI;
namespace FastBill.ViewModels;
public class CustomerViewModel: ViewModelBase, IViewModelBase
{
private string _term;
public string Term
{
get => _term;
set => SetAndRaisePropertyChanged(ref _term, value);
}
private CustomerService _customerService;
public ReactiveCommand<Unit, Unit> SearchCustomer { get; }
public CustomerViewModel(CustomerService customerService)
{
Term = "";
_customerService = customerService;
SearchCustomer = ReactiveCommand.Create(searchTerm);
}
async void searchTerm()
{
var list = await _customerService.SearchCustomer(Term);
}
}