AddOutletsViewModel.cs 613 B

123456789101112131415161718192021222324
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using Acosta.Models;
  5. using ReactiveUI;
  6. namespace Acosta.ViewModels
  7. {
  8. public class AddOutletsViewModel : ReactiveObject
  9. {
  10. SuharevaContext myC;
  11. Outlet? currentOutlet;
  12. public AddOutletsViewModel(SuharevaContext myC)
  13. {
  14. this.myC = myC;
  15. CurrentOutlet = new Outlet();
  16. myC.Add(CurrentOutlet);
  17. }
  18. public List<TradeNetwork> Trades => myC.TradeNetworks.ToList();
  19. public Outlet? CurrentOutlet { get => currentOutlet; set => currentOutlet = value; }
  20. }
  21. }