TourPart.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using Avalonia.Media;
  2. using Avalonia.Media.Imaging;
  3. using Avalonia.Platform;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using System.Windows;
  11. namespace TourAgent.Models
  12. {
  13. public partial class Tourss
  14. {
  15. public Avalonia.Media.Imaging.Bitmap GetPic
  16. {
  17. get
  18. {
  19. Avalonia.Media.Imaging.Bitmap pic = null;
  20. try
  21. {
  22. pic = new Avalonia.Media.Imaging.Bitmap($"Pictures/{Name}.jpg");
  23. return pic;
  24. }
  25. catch
  26. {
  27. pic = new Avalonia.Media.Imaging.Bitmap("Pictures/pic.png");
  28. return pic;
  29. }
  30. }
  31. }
  32. public string GetActual
  33. {
  34. get
  35. {
  36. if (IsActual[0] == true)
  37. {
  38. return "Актуален";
  39. }
  40. else
  41. {
  42. return "Не актуален";
  43. }
  44. }
  45. }
  46. public SolidColorBrush GetColor
  47. {
  48. get
  49. {
  50. if (IsActual[0] == true)
  51. {
  52. return new SolidColorBrush(Avalonia.Media.Color.FromRgb(10, 206, 76));
  53. }
  54. else
  55. {
  56. return new SolidColorBrush(Avalonia.Media.Color.FromRgb(249, 0, 0));
  57. }
  58. }
  59. }
  60. }
  61. }