using System;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Markup;

namespace QFDT_Components;

public partial class ShowInfo_WrongWCN : UserControl, IComponentConnector
{
	public ShowInfo_WrongWCN()
	{
		InitializeComponent();
	}

	private void SetLanguageDictionary()
	{
		ResourceDictionary resourceDictionary = new ResourceDictionary();
		string text = Thread.CurrentThread.CurrentCulture.ToString();
		try
		{
			resourceDictionary.Source = new Uri(Thread.GetDomain().BaseDirectory + "..\\Resources\\UI_" + text + ".xaml", UriKind.Absolute);
		}
		catch
		{
		}
		base.Resources.MergedDictionaries.Add(resourceDictionary);
	}

	public void SetLanguage(string culture)
	{
		ResourceDictionary resourceDictionary = new ResourceDictionary();
		try
		{
			resourceDictionary.Source = new Uri(Thread.GetDomain().BaseDirectory + "\\Resources\\UI_" + culture + ".xaml", UriKind.Absolute);
		}
		catch
		{
			resourceDictionary.Source = new Uri(Thread.GetDomain().BaseDirectory + "..\\Resources\\UI_en-US.xaml", UriKind.Absolute);
		}
		base.Resources.MergedDictionaries.Clear();
		base.Resources.MergedDictionaries.Add(resourceDictionary);
	}
}
