src/FingersDance/MainSurfaceWindow.xaml.cs
changeset 230 010a2af88bb7
parent 229 05aba5def1fc
parent 227 89f9e7e3ff54
equal deleted inserted replaced
229:05aba5def1fc 230:010a2af88bb7
    41         private UserControlUserPanel Panel2 = null;
    41         private UserControlUserPanel Panel2 = null;
    42         private UserControlUserPanel Panel3 = null;
    42         private UserControlUserPanel Panel3 = null;
    43         private UserControlUserPanel Panel4 = null;
    43         private UserControlUserPanel Panel4 = null;
    44         ActionGenerator _Factory = (new ActionFactory()).GetGenerator();
    44         ActionGenerator _Factory = (new ActionFactory()).GetGenerator();
    45         private MainViewModel _mainviewmodel = new MainViewModel();
    45         private MainViewModel _mainviewmodel = new MainViewModel();
       
    46         bool pivotContactDown = false;
    46         #endregion
    47         #endregion
    47 
    48 
    48 
    49 
    49         #region Constructor
    50         #region Constructor
    50         public SurfaceWindow1()
    51         public SurfaceWindow1()
   326         private void ScatterViewItemPivot_ContactLeave(object sender, ContactEventArgs e)
   327         private void ScatterViewItemPivot_ContactLeave(object sender, ContactEventArgs e)
   327         {
   328         {
   328             //Permet la MAJ des 4 Grids à la position du pivot
   329             //Permet la MAJ des 4 Grids à la position du pivot
   329             try
   330             try
   330             {
   331             {
   331                 Grid1.Width = e.GetPosition(mainSurfaceWindow).X;
   332                 if (!pivotContactDown)
   332                 Grid1.Height = e.GetPosition(mainSurfaceWindow).Y;
   333                 {
   333 
   334                     Grid1.Width = e.GetPosition(mainSurfaceWindow).X;
   334                 Grid3.Width = e.GetPosition(mainSurfaceWindow).X;
   335                     Grid1.Height = e.GetPosition(mainSurfaceWindow).Y;
   335                 Grid3.Height = 768 - e.GetPosition(mainSurfaceWindow).Y;
   336 
   336 
   337                     Grid3.Width = e.GetPosition(mainSurfaceWindow).X;
   337                 Grid4.Width = 1024 - e.GetPosition(mainSurfaceWindow).X;
   338                     Grid3.Height = 768 - e.GetPosition(mainSurfaceWindow).Y;
   338                 Grid4.Height = 768 - e.GetPosition(mainSurfaceWindow).Y;
   339 
   339 
   340                     Grid4.Width = 1024 - e.GetPosition(mainSurfaceWindow).X;
   340                 Grid2.Width = 1024 - e.GetPosition(mainSurfaceWindow).X;
   341                     Grid4.Height = 768 - e.GetPosition(mainSurfaceWindow).Y;
   341                 Grid2.Height = e.GetPosition(mainSurfaceWindow).Y;
   342 
   342                 ((ScatterViewItem)sender).Center = new Point(e.GetPosition(mainSurfaceWindow).X,e.GetPosition(mainSurfaceWindow).Y);
   343                     Grid2.Width = 1024 - e.GetPosition(mainSurfaceWindow).X;
       
   344                     Grid2.Height = e.GetPosition(mainSurfaceWindow).Y;
       
   345                     ((ScatterViewItem)sender).Center = new Point(e.GetPosition(mainSurfaceWindow).X, e.GetPosition(mainSurfaceWindow).Y);
       
   346                 }
       
   347                 pivotContactDown = false;
   343             }
   348             }
   344             catch (Exception) { }
   349             catch (Exception) { }
   345         }
   350         }
   346 
   351 
   347         private void UserControlPivot_EH_SurfaceButtonPlayer_ContactDown(object sender, EventArgs e)
   352         private void UserControlPivot_EH_SurfaceButtonPlayer_ContactDown(object sender, EventArgs e)
   348         {
   353         {
       
   354             pivotContactDown = true;
   349             //  Traitement du contact down sur le pivot (Création d'un screen ou suppression d'un panel
   355             //  Traitement du contact down sur le pivot (Création d'un screen ou suppression d'un panel
   350             switch ((int)sender)
   356             switch ((int)sender)
   351             {
   357             {
   352                 case 1:
   358                 case 1:
   353                     if (Panel1 == null && Grid1.Children.Count == 3)
   359                     if (Panel1 == null && Grid1.Children.Count == 3)
   440                             UCclose.ConfirmYesOrNo += new EventHandler<ConfirmEventArgs>(CloseAlert_EH_SurfaceButton_ContactDown);
   446                             UCclose.ConfirmYesOrNo += new EventHandler<ConfirmEventArgs>(CloseAlert_EH_SurfaceButton_ContactDown);
   441                         }
   447                         }
   442                     }
   448                     }
   443                     break;
   449                     break;
   444             }
   450             }
   445 
       
   446         }
   451         }
   447 
   452 
   448         #endregion
   453         #endregion
   449 
   454 
   450 
   455