using Avalonia.Media;
using Avalonia.Media.Imaging;
using Avalonia.Platform;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace TourAgent.Models
{
    public partial class Tourss
    {
        public Avalonia.Media.Imaging.Bitmap GetPic
        {
            get
            {
                Avalonia.Media.Imaging.Bitmap pic = null;
                try
                {
                    pic = new Avalonia.Media.Imaging.Bitmap($"Pictures/{Name}.jpg");
                    return pic;
                }
                catch
                {
                    pic = new Avalonia.Media.Imaging.Bitmap("Pictures/pic.png");
                    return pic;
                }
            }
        }

        public string GetActual
        {
            get
            {
                if (IsActual[0] == true)
                {
                    return "Актуален";
                }
                else
                {
                    return "Не актуален";
                }
            }
        }

        public SolidColorBrush GetColor
        {
            get
            {
                if (IsActual[0] == true)
                {
                    return new SolidColorBrush(Avalonia.Media.Color.FromRgb(10, 206, 76));
                }
                else
                {
                    return new SolidColorBrush(Avalonia.Media.Color.FromRgb(249, 0, 0));
                }
            }
        }
    }
}
