VirtualCaseViewModel.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System.Windows.Media;
  2. namespace AIPractice.LabellerServer.ViewModels
  3. {
  4. class VirtualCaseViewModel:ViewModel
  5. {
  6. public string Id { get; }
  7. public string Name { get; }
  8. public string Description { get; }
  9. public int TotalCount { get; }
  10. public int LeftCount { get; }
  11. public Brush Color { get; }
  12. public bool NotStarted => LeftCount == TotalCount;
  13. public VirtualCaseAccountViewModel Account { get; }
  14. public VirtualCaseViewModel(string id, string name,string description, int totalCount, int leftCount, VirtualCaseAccountViewModel account)
  15. {
  16. Id = id;
  17. Name = name;
  18. Description = description;
  19. TotalCount = totalCount;
  20. LeftCount = leftCount;
  21. Account = account;
  22. if (leftCount == 0)
  23. {
  24. Color = Brushes.Green;
  25. }
  26. else if (leftCount == totalCount)
  27. {
  28. Color = Brushes.Red;
  29. }
  30. else if (LeftCount < totalCount)
  31. {
  32. Color = Brushes.Orange;
  33. }
  34. }
  35. }
  36. }