using FLY.Thick.BlowingScan.Server;
using FLY.Thick.BlowingScan.Server.OBJProxy;
using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Navigation;

namespace FLY.Thick.BlowingScan.UI.Server
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : NavigationWindow
    {
        FLY.AppHelper.WindowNotifyIconHelper notifyiconhelper;
        TDGage mGage;
        OBJProxys mOBJProxy;
        public MainWindow()
        {
            InitializeComponent();
            PgLoading p = new PgLoading();
            this.Navigate(p);

            this.Title = (new Misc.Ver() { SrcType = typeof(MainWindow) }).ToString();

            notifyiconhelper = new AppHelper.WindowNotifyIconHelper(this, this.Title);

        }

        private async void NavigationWindow_Loaded(object sender, RoutedEventArgs _e)
        {
            mGage = new TDGage("Gage1");
            await mGage.Init();

            mOBJProxy = new OBJProxys(0, mGage);

            FObjBase.PollModule.Current.Start();


            this.Hide();
            PgMain p = new PgMain();
            p.Init(mGage);
            this.Navigate(p);
            this.NavigationService.RemoveBackEntry();


        }
    }
}