using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Media.Imaging;
using demko_term.Models;

namespace demko_term;

public partial class VolunteerWindow : Window
{
    public VolunteerWindow(Employee employee)
    {
        InitializeComponent();
        FioTextBlock.Text = employee.Lastname + " " + employee.Firstname + " " + employee.Patronymic;
        RoleTextBlock.Text = employee.Position.Title;

        try
        {
            string absolutePath = Path.Combine(AppContext.BaseDirectory, employee.Logo);
            EmployeeImage.Source = new Bitmap(absolutePath);
        }
        catch
        {
            EmployeeImage.Source = null;
        }
    }
    
    private void InfoSpecialtyButton_OnClick(object? sender, RoutedEventArgs e)
    {
        BlankWindow blankWindow = new BlankWindow();
        blankWindow.ShowDialog(this);
    }
}