src/FingersDance/MainSurfaceWindow.xaml.cs
changeset 224 874de6d84a2e
parent 223 90d2be5c3d39
child 225 b60e13ed75c8
equal deleted inserted replaced
223:90d2be5c3d39 224:874de6d84a2e
   217                 if (Grid1.Width < (1024 / 4) || Grid2.Height < (768 / 4))
   217                 if (Grid1.Width < (1024 / 4) || Grid2.Height < (768 / 4))
   218                 {
   218                 {
   219                     try
   219                     try
   220                     {
   220                     {
   221                         if (Panel1 != null)
   221                         if (Panel1 != null)
       
   222                         {
   222                             Panel1.PlayerPause();
   223                             Panel1.PlayerPause();
       
   224                             Panel1.PanelVisibility(Visibility.Hidden);
       
   225                         }
   223                         Grid1.Children[1].Visibility = Visibility.Hidden;
   226                         Grid1.Children[1].Visibility = Visibility.Hidden;
       
   227 
   224                     }
   228                     }
   225                     catch (Exception) { }
   229                     catch (Exception) { }
   226                 }
   230                 }
   227                 else
   231                 else
   228                 {
   232                 {
   229                     try
   233                     try
   230                     { 
   234                     { 
   231                         Grid1.Children[1].Visibility = Visibility.Visible; 
   235                         Grid1.Children[1].Visibility = Visibility.Visible;
       
   236                         if (Panel1 != null)
       
   237                         {
       
   238                             Panel1.PanelVisibility(Visibility.Visible);
       
   239                         }
   232                     }
   240                     }
   233                     catch (Exception) { }
   241                     catch (Exception) { }
   234                 }
   242                 }
   235                 //Grid2
   243                 //Grid2
   236                 if (Grid2.Width < (1024 / 4) || Grid2.Height < (768 / 4))
   244                 if (Grid2.Width < (1024 / 4) || Grid2.Height < (768 / 4))
   237                 {
   245                 {
   238                     try
   246                     try
   239                     {
   247                     {
   240                         if (Panel2 != null)
   248                         if (Panel2 != null)
       
   249                         {
   241                             Panel2.PlayerPause();
   250                             Panel2.PlayerPause();
       
   251                             Panel2.PanelVisibility(Visibility.Hidden);
       
   252                         }
   242                         Grid2.Children[1].Visibility = Visibility.Hidden; 
   253                         Grid2.Children[1].Visibility = Visibility.Hidden; 
   243                     }
   254                     }
   244                     catch (Exception) { }
   255                     catch (Exception) { }
   245                 }
   256                 }
   246                 else
   257                 else
   247                 {
   258                 {
   248                     try
   259                     try
   249                     {
   260                     {
   250                         Grid2.Children[1].Visibility = Visibility.Visible; 
   261                         Grid2.Children[1].Visibility = Visibility.Visible;
       
   262                         if (Panel2 != null)
       
   263                         {
       
   264                             Panel2.PanelVisibility(Visibility.Visible);
       
   265                         }
   251                     }
   266                     }
   252                     catch (Exception) { }
   267                     catch (Exception) { }
   253                 }
   268                 }
   254                 //Grid3
   269                 //Grid3
   255                 if (Grid3.Width < (1024 / 4) || Grid3.Height < (768 / 4))
   270                 if (Grid3.Width < (1024 / 4) || Grid3.Height < (768 / 4))
   256                 {
   271                 {
   257                     try
   272                     try
   258                     {
   273                     {
   259                         if (Panel3 != null)
   274                         if (Panel3 != null)
       
   275                         {
   260                             Panel3.PlayerPause();
   276                             Panel3.PlayerPause();
       
   277                             Panel3.PanelVisibility(Visibility.Hidden);
       
   278                         }
   261                         Grid3.Children[1].Visibility = Visibility.Hidden;
   279                         Grid3.Children[1].Visibility = Visibility.Hidden;
   262                     }
   280                     }
   263                     catch (Exception) { }
   281                     catch (Exception) { }
   264                 }
   282                 }
   265                 else
   283                 else
   266                 {
   284                 {
   267                     try
   285                     try
   268                     {
   286                     {
   269                         Grid3.Children[1].Visibility = Visibility.Visible; 
   287                         Grid3.Children[1].Visibility = Visibility.Visible;
       
   288                         if (Panel3 != null)
       
   289                         {
       
   290                             Panel3.PanelVisibility(Visibility.Visible);
       
   291                         }
   270                     }
   292                     }
   271                     catch (Exception) { }
   293                     catch (Exception) { }
   272                 }
   294                 }
   273                 //Grid4
   295                 //Grid4
   274                 if (Grid4.Width < (1024 / 4) || Grid4.Height < (768 / 4))
   296                 if (Grid4.Width < (1024 / 4) || Grid4.Height < (768 / 4))
   275                 {
   297                 {
   276                     try
   298                     try
   277                     {
   299                     {
   278                         if (Panel4 != null)
   300                         if (Panel4 != null)
       
   301                         {
   279                             Panel4.PlayerPause();
   302                             Panel4.PlayerPause();
       
   303                             Panel4.PanelVisibility(Visibility.Hidden);
       
   304                         }
   280                         Grid4.Children[1].Visibility = Visibility.Hidden;
   305                         Grid4.Children[1].Visibility = Visibility.Hidden;
   281                     }
   306                     }
   282                     catch (Exception) { }
   307                     catch (Exception) { }
   283                 }
   308                 }
   284                 else
   309                 else
   285                 {
   310                 {
   286                     try
   311                     try
   287                     { 
   312                     { 
   288                         Grid4.Children[1].Visibility = Visibility.Visible;
   313                         Grid4.Children[1].Visibility = Visibility.Visible;
       
   314                         if (Panel4 != null)
       
   315                         {
       
   316                             Panel4.PanelVisibility(Visibility.Visible);
       
   317                         }
   289                     }
   318                     }
   290                     catch (Exception) { }
   319                     catch (Exception) { }
   291                 }
   320                 }
       
   321             }
       
   322             catch (Exception) { }
       
   323         }
       
   324 
       
   325         //SAR
       
   326         private void ScatterViewItemPivot_ContactLeave(object sender, ContactEventArgs e)
       
   327         {
       
   328             //Permet la MAJ des 4 Grids à la position du pivot
       
   329             try
       
   330             {
       
   331                 Grid1.Width = e.GetPosition(mainSurfaceWindow).X;
       
   332                 Grid1.Height = e.GetPosition(mainSurfaceWindow).Y;
       
   333 
       
   334                 Grid3.Width = e.GetPosition(mainSurfaceWindow).X;
       
   335                 Grid3.Height = 768 - e.GetPosition(mainSurfaceWindow).Y;
       
   336 
       
   337                 Grid4.Width = 1024 - e.GetPosition(mainSurfaceWindow).X;
       
   338                 Grid4.Height = 768 - e.GetPosition(mainSurfaceWindow).Y;
       
   339 
       
   340                 Grid2.Width = 1024 - e.GetPosition(mainSurfaceWindow).X;
       
   341                 Grid2.Height = e.GetPosition(mainSurfaceWindow).Y;
       
   342                 ((ScatterViewItem)sender).Center = new Point(e.GetPosition(mainSurfaceWindow).X,e.GetPosition(mainSurfaceWindow).Y);
   292             }
   343             }
   293             catch (Exception) { }
   344             catch (Exception) { }
   294         }
   345         }
   295 
   346 
   296         private void UserControlPivot_EH_SurfaceButtonPlayer_ContactDown(object sender, EventArgs e)
   347         private void UserControlPivot_EH_SurfaceButtonPlayer_ContactDown(object sender, EventArgs e)
   500                 switch(e.PanelNumber)
   551                 switch(e.PanelNumber)
   501                 {
   552                 {
   502                     case 1:
   553                     case 1:
   503                         UserControlPivot.ApplyColor(1, 0);
   554                         UserControlPivot.ApplyColor(1, 0);
   504                         root.Children.Remove(Panel1);
   555                         root.Children.Remove(Panel1);
       
   556                         Panel1.PanelClose();
   505                         Panel1 = null;
   557                         Panel1 = null;
   506                         break;
   558                         break;
   507                     case 2:
   559                     case 2:
   508                         UserControlPivot.ApplyColor(2, 0);
   560                         UserControlPivot.ApplyColor(2, 0);
   509                         root.Children.Remove(Panel2);
   561                         root.Children.Remove(Panel2);
       
   562                         Panel2.PanelClose();
   510                         Panel2 = null;
   563                         Panel2 = null;
   511                         break;
   564                         break;
   512                     case 3:
   565                     case 3:
   513                         UserControlPivot.ApplyColor(3, 0);
   566                         UserControlPivot.ApplyColor(3, 0);
   514                         root.Children.Remove(Panel3);
   567                         root.Children.Remove(Panel3);
       
   568                         Panel3.PanelClose();
   515                         Panel3 = null;
   569                         Panel3 = null;
   516                         break;
   570                         break;
   517                     case 4:
   571                     case 4:
   518                         UserControlPivot.ApplyColor(4, 0);
   572                         UserControlPivot.ApplyColor(4, 0);
   519                         root.Children.Remove(Panel4);
   573                         root.Children.Remove(Panel4);
       
   574                         Panel4.PanelClose();
   520                         Panel4 = null;
   575                         Panel4 = null;
   521                         break;
   576                         break;
   522                 }
   577                 }
   523             }
   578             }
   524             root.Children.Remove(((UserControlClose)sender));
   579             root.Children.Remove(((UserControlClose)sender));
   649             else if (sender == CreditsButton4)
   704             else if (sender == CreditsButton4)
   650             {
   705             {
   651                 CreditsScroll4.Visibility = (CreditsScroll4.Visibility == Visibility.Hidden) ? Visibility.Visible : Visibility.Hidden;
   706                 CreditsScroll4.Visibility = (CreditsScroll4.Visibility == Visibility.Hidden) ? Visibility.Visible : Visibility.Hidden;
   652             }
   707             }
   653         }
   708         }
       
   709 
       
   710         
   654     }
   711     }
   655 }
   712 }