using System;
using System.IO;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Navigation;

namespace FingersDance.Control.Menu
{
	public partial class UserControlMenu
	{
		public UserControlMenu()
		{
			this.InitializeComponent();
            initChildSize();

			// Insert code required on object creation below this point.
		}

        //Premet de deplacer les sous menus vers la droite pour avoir un effect tree view
         private void initChildSize()
        {
             //Niveau 1
            PanelAnnotation.Width -= 0.10*this.Width;
            PanelRecherche.Width -= 0.10 * this.Width;
             //Niveau 2
            PanelChildChore.Width -= 0.10 * this.Width;
            PanelChildCine.Width -= 0.10 * this.Width;
             //Niveau 3
            PanelChild1AxeCam.Width -= 0.05 * this.Width;
            PanelChild1MouvCam.Width -= 0.05 * this.Width;

        }

         #region Events
         //Annotation
        private void ButtonAnnotation_ContactDown(object sender, Microsoft.Surface.Presentation.ContactEventArgs e)
        {
            if (PanelAnnotation.Visibility == Visibility.Collapsed)
            {
                PanelAnnotation.Visibility = Visibility.Visible;
            }
            else
            {
                PanelAnnotation.Visibility = Visibility.Collapsed;
            }
        }

        private void ButtonAnnotation_Click(object sender, RoutedEventArgs e)
        {
            if (PanelAnnotation.Visibility == Visibility.Collapsed)
            {
                PanelAnnotation.Visibility = Visibility.Visible;
            }
            else
            {
                PanelAnnotation.Visibility = Visibility.Collapsed;
            }
        }
        //Recherche
        private void ButtonRecherche_ContactDown(object sender, Microsoft.Surface.Presentation.ContactEventArgs e)
        {
            if (PanelRecherche.Visibility == Visibility.Collapsed)
            {
                PanelRecherche.Visibility = Visibility.Visible;
            }
            else
            {
                PanelRecherche.Visibility = Visibility.Collapsed;
            }
        }           
        
        private void ButtonRecherche_Click(object sender, RoutedEventArgs e)
        {
            if (PanelRecherche.Visibility == Visibility.Collapsed)
            {
                PanelRecherche.Visibility = Visibility.Visible;
            }
            else
            {
                PanelRecherche.Visibility = Visibility.Collapsed;
            }
        }
        //ChildCine
        private void ButtonChildCine_ContactDown(object sender, Microsoft.Surface.Presentation.ContactEventArgs e)
        {
            if (PanelChildCine.Visibility == Visibility.Collapsed)
            {
                PanelChildCine.Visibility = Visibility.Visible;
            }
            else
            {
                PanelChildCine.Visibility = Visibility.Collapsed;
            } 
        }

        private void ButtonChildCine_Click(object sender, RoutedEventArgs e)
        {
            if (PanelChildCine.Visibility == Visibility.Collapsed)
            {
                PanelChildCine.Visibility = Visibility.Visible;
            }
            else
            {
                PanelChildCine.Visibility = Visibility.Collapsed;
            }
        }
        //ChildCore
        private void ButtonChildChore_Click(object sender, RoutedEventArgs e)
        {
            if (PanelChildChore.Visibility == Visibility.Collapsed)
            {
                PanelChildChore.Visibility = Visibility.Visible;
            }
            else
            {
                PanelChildChore.Visibility = Visibility.Collapsed;
            }
        }

        private void ButtonChildChore_ContactDown(object sender, Microsoft.Surface.Presentation.ContactEventArgs e)
        {
            if (PanelChildChore.Visibility == Visibility.Collapsed)
            {
                PanelChildChore.Visibility = Visibility.Visible;
            }
            else
            {
                PanelChildChore.Visibility = Visibility.Collapsed;
            }
        }
        //Child1MouvCam
        private void ButtonChild1MouvCam_Click(object sender, RoutedEventArgs e)
        {
            if (PanelChild1MouvCam.Visibility == Visibility.Collapsed)
            {
                PanelChild1MouvCam.Visibility = Visibility.Visible;
            }
            else
            {
                PanelChild1MouvCam.Visibility = Visibility.Collapsed;
            }
        }

        private void ButtonChild1MouvCam_ContactDown(object sender, Microsoft.Surface.Presentation.ContactEventArgs e)
        {
            if (PanelChild1MouvCam.Visibility == Visibility.Collapsed)
            {
                PanelChild1MouvCam.Visibility = Visibility.Visible;
            }
            else
            {
                PanelChild1MouvCam.Visibility = Visibility.Collapsed;
            }
        }
        //Child1AxeCam
        private void buttonChild1AxeCam_Click(object sender, RoutedEventArgs e)
        {
            if (PanelChild1AxeCam.Visibility == Visibility.Collapsed)
            {
                PanelChild1AxeCam.Visibility = Visibility.Visible;
            }
            else
            {
                PanelChild1AxeCam.Visibility = Visibility.Collapsed;
            }
        }

        private void buttonChild1AxeCam_ContactDown(object sender, Microsoft.Surface.Presentation.ContactEventArgs e)
        {
            if (PanelChild1AxeCam.Visibility == Visibility.Collapsed)
            {
                PanelChild1AxeCam.Visibility = Visibility.Visible;
            }
            else
            {
                PanelChild1AxeCam.Visibility = Visibility.Collapsed;
            }
        }
        #endregion

    
    }
}