/// <summary>
        /// Default Constructor for MainWindow
        /// </summary>
        public MainWindow()
        {


            lngHandler = new LanguageHandler(this);

            if (!System.IO.Directory.Exists(Constants.CACHE_PATH))
            {
                CultureInfo ci = CultureInfo.InstalledUICulture;
                if (ci.TwoLetterISOLanguageName == "en")
                {
                    lngHandler.language = Org.language.Language.ENGLISH;
                    
                }
                else if (ci.TwoLetterISOLanguageName == "es")
                {
                    lngHandler.language = Org.language.Language.SPANISH;

                }
                else if (ci.TwoLetterISOLanguageName == "ru")
                {
                    lngHandler.language = Org.language.Language.RUSSIAN;
                }
            }

            theme = new ThemeSystem();
            
            InitializeComponent();

            tab.selected = 0;
            tab.owner = this;

            redSlider.setValue(0);
            greenSlider.setValue(0);
            blueSlider.setValue(0);

            redSlider.Margin = new Thickness(-135, 230, 0, 0);
            redSlider.owner = this;
            greenSlider.Margin = new Thickness(-135, 330, 0, 0);
            greenSlider.owner = this;
            blueSlider.Margin = new Thickness(-135, 430, 0, 0);
            blueSlider.owner = this;
            redSlider.MouseDown += new MouseButtonEventHandler(sliderMouseDownRed);
            redSlider.MouseUp += new MouseButtonEventHandler(sliderMouseUp);
            greenSlider.MouseDown += new MouseButtonEventHandler(sliderMouseDownGreen);
            greenSlider.MouseUp += new MouseButtonEventHandler(sliderMouseUp);
            blueSlider.MouseDown += new MouseButtonEventHandler(sliderMouseDownBlue);
            blueSlider.MouseUp += new MouseButtonEventHandler(sliderMouseUp);

            gridColourGenerator.Children.Add(redSlider);
            gridColourGenerator.Children.Add(greenSlider);
            gridColourGenerator.Children.Add(blueSlider);

            timerSC.Tick += timerSCEvent;
            timerSC.Interval = new TimeSpan(0, 0, 0, 0, 100);

            timerCT.Tick += timerCTEvent;
            timerCT.Interval = new TimeSpan(0, 0, 0, 0, 30);

            lastSelected = imgSelector1;
            populateThemeList();
            

            colourzSave = new SavedColourzSaver(this, stkSavedColours);
            colourzSave.load();

            savedTheme = new SavedThemesSaver(this, CTThemes);
            savedTheme.load();
            settings = new Settings(this);
            settings.load();

            lngHandler.updateLanguage();
        }
 public ThemeSystemLoader(ThemeSystem owner)
 {
     this.owner = owner;
 }
 public ThemeSystemSaver(ThemeSystem owner)
 {
     this.owner = owner;
 }