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 SmartAquaViewer.DataAnalysis;
using SmartAquaViewer.Model;

namespace SmartAquaViewer
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

            StateChanged += MainWindow_StateChanged;
        }

        private void WindowNormal_Click(object sender, RoutedEventArgs e)
        {
            WindowState = WindowState.Normal;
            appTitle.Margin = new Thickness(20, 0, 0, 0);
        }

        private void WindowMax_Click(object sender, RoutedEventArgs e)
        {
            WindowState = WindowState.Maximized;
            appTitle.Margin = new Thickness(20, 5, 0, 0);
        }

        private void WindowMin_Click(object sender, RoutedEventArgs e)
        {
            WindowState = WindowState.Minimized;
        }

        private void WindowClose_Click(object sender, RoutedEventArgs e)
        {
            Close();
        }

        private void MainWindow_StateChanged(object sender, EventArgs e)
        {
            if (WindowState == WindowState.Maximized)
            {
                windowNormal.Visibility = Visibility.Visible;
                windowMax.Visibility = Visibility.Collapsed;
            }
            else if (WindowState == WindowState.Normal)
            {
                windowNormal.Visibility = Visibility.Collapsed;
                windowMax.Visibility = Visibility.Visible;
            }
        }
    }
}