﻿using LiveChartsCore.SkiaSharpView.SKCharts;
using LiveChartsCore.SkiaSharpView.WinForms;
using SkiaSharp;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WinFormsApp2
{
    public partial class Form1 : Form
    {
        private bool sidebarVisible = true;
        private int sidebarWidth = 200;

        private UserControl1 mainControl = new UserControl1();
        private UserControl2 admin_vm_control = new UserControl2();
        private UserControl3 monitor_ta_control = new UserControl3();


        public Form1()
        {
            InitializeComponent();
            ShowControl(mainControl);
        }

        private void ShowControl(UserControl control)
        {
            panelContent.Controls.Clear();
            control.Dock = DockStyle.Fill;
            panelContent.Controls.Add(control);
        }


        private void label3_Click(object sender, EventArgs e)
        {
            contextMenuStrip1.Show(label3, new Point(0, label3.Height));
        }

        private void label16_Click(object sender, EventArgs e)
        {
            contextMenuStrip2.Show(label16, new Point(0, label3.Height));
        }

        private void label9_Click(object sender, EventArgs e)
        {
        }

        private void label9_Click_1(object sender, EventArgs e)
        {
            ShowControl(mainControl);
        }

        private void label8_Click(object sender, EventArgs e)
        {
            panelSidebar.Width = sidebarVisible ? 30 : 200;
            if (sidebarVisible)
            {

                foreach (Control c in panelSidebar.Controls)
                {
                    if (c != label8)
                        c.Visible = false;
                }

            }
            else
            {
                foreach (Control c in panelSidebar.Controls)
                {
                    c.Visible = true;
                }

            }
            sidebarVisible = !sidebarVisible;

        }

        private void торговыеАвтоматыToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ShowControl(admin_vm_control);
        }

        private void label10_Click(object sender, EventArgs e)
        {
            ShowControl(monitor_ta_control);
        }
    }
}
