using System.Windows;
using System.Windows.Controls;
using System.Windows.Markup;
using Microsoft.Win32;

namespace QFDT_Components;

public partial class Resource : UserControl, IComponentConnector
{
	public string ResourceFile => txtResource.Text;

	public string Description => txtDescription.Text;

	public Resource()
	{
		InitializeComponent();
	}

	private void bnBrowse_Click(object sender, RoutedEventArgs e)
	{
		OpenFileDialog openFileDialog = new OpenFileDialog();
		openFileDialog.Filter = "Resource Files (*.jpg, *.pdf, *.txt)|*.jpg;*.pdf;*.txt;| Other Files (*.*)|*.*";
		if (openFileDialog.ShowDialog() == true)
		{
			string fileName = openFileDialog.FileName;
			txtResource.Text = fileName;
		}
	}
}
