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 System.Threading.Tasks;
using SPC.Kiosk.Base;
using SPC.Kiosk.Common;
using SPC.Kiosk.Start;
using SPC.Kiosk.Start.ViewModel;
using SPC.Kiosk.PB;
using SPC.Kiosk.PB.ViewModel;
namespace TestProject
{
    /// <summary>
    /// MainWindow.xaml에 대한 상호 작용 논리
    /// </summary>
    public partial class MainWindow : Window
    {
        private StartWindow StartWin;
        private VmStartViewModel dataContext; 
        public MainWindow()
        {
            InitializeComponent();
            


        }

        private void MainWindow_Unloaded(object sender, RoutedEventArgs e)
        {
        }

        private void BtnStartWin1_Click(object sender, RoutedEventArgs e)
        {
            if (dataContext != null) return;
            StartWin = new StartWindow(new Size(768,1024));
            dataContext = new VmStartViewModel(0, new Size(768, 1024));
            StartWin.DataContext = dataContext;
            StartWin.ShowDialog();
            this.Close();

        }
        private void BtnStartWin2_Click(object sender, RoutedEventArgs e)
        {
            if (dataContext != null) return;
            StartWin = new StartWindow(1, new Size(768, 1440));
            dataContext = new VmStartViewModel(1, new Size(768, 1440));
            StartWin.DataContext = dataContext;
            StartWin.ShowDialog();
            this.Close();
        }
        private void BtnStartWin3_Click(object sender, RoutedEventArgs e)
        {
            if (dataContext != null) return;
            StartWin = new StartWindow(2);
            dataContext = new VmStartViewModel(2, new Size(0, 0));
            StartWin.DataContext = dataContext;
            StartWin.ShowDialog();
            this.Close();
        }
        private void BtnStartWin4_Click(object sender, RoutedEventArgs e)
        {
            if (dataContext != null) return;
            StartWin = new StartWindow(2, new Size(768, 1024));
            dataContext = new VmStartViewModel(2, new Size(768, 1024));
            StartWin.DataContext = dataContext;
            StartWin.ShowDialog();
            this.Close();
        }

        private void BtnStartWin0_Click(object sender, RoutedEventArgs e)
        {
            if (dataContext != null) return;
            StartWin = new StartWindow();
            dataContext = new VmStartViewModel(0, new Size(0, 0));
            StartWin.DataContext = dataContext;
            StartWin.ShowDialog();
            this.Close();
        }

        private void BtnPBWin0_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var newPBWin = new PBWindow();
                newPBWin.ShowDialog();
                newPBWin = null;
            }
            catch 
            {
                throw;
            }
            finally
            {
                this.Close();
            }
        }
    }
}
