﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using zComp.Core;
using zComp.Wpf;
using System.Collections.ObjectModel;
using System.Threading;
using System.IO;
using System.Reflection;

namespace DemoZComp
{
    public partial class MainWindow : Window
    {
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();
        }


        /// <summary>Constructeur</summary>
        public MainWindow() : base()
        {
            InitializeComponent();

            var themes = Enum.GetValues(typeof(ZCompTheme)).OfType<ZCompTheme>().Where(el => el != ZCompTheme.DefaultTheme).ToList();
            cbThemes.ItemsSource = themes;
            cbThemes.SelectedItem = themes[0];

            // Affichage d'une exception dans le viewer dédié
            evExceptionViewer.Exception = Repository.ExceptiondeTest;
        }


        /// <summary>Click sur un bouton de la zButtonsTextBox</summary>
        /// <param name="source">Appelant</param>
        /// <param name="e">Arguments</param>

        private void cbThemes_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            zComp.Wpf.ThemeHelper.ApplyZCompTheme((ZCompTheme)cbThemes.SelectedItem);
        }
    }

}


