using Install.Core;
using Install.Core.Common;
using Install.View;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
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;

namespace Install
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : NavigationWindow
    {
        InstallWizard installWizard;
        public MainWindow()
        {
            InitializeComponent();


            Ver ver = new Ver() { SrcType = this.GetType() };

            this.Title = ver.ToString();

            installWizard = new InstallWizard();
            if (!installWizard.Init()) 
            {
                //异常，不能找到安装包
                MessageBox.Show(installWizard.Msg, "异常", MessageBoxButton.OK, MessageBoxImage.Error);
                App.Current.Shutdown();
                return;
            }

            Application.Current.Properties[nameof(InstallWizard)] = installWizard;
            Application.Current.Properties["NavigationService"] = NavigationService;
            Pg1st p = new Pg1st();
            p.Init();
            NavigationService.Navigate(p);
        }
    }
}
