Example #1
0
        private void OnManipulationCompleted(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
        {
            Point transformedTranslation = GetTransformNoTranslation(_transform).Transform(e.TotalManipulation.Translation);

            if (transformedTranslation.X > 0)
            {
                IsOpen = true;
            }
            else if (transformedTranslation.X < 0)
            {
                IsOpen = false;
            }
        }
Example #2
0
 void Control_ManipulationCompleted(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
 {
     if (e.IsInertial)
     {
         FrameworkElement control  = sender as FrameworkElement;
         GestureRenderer  renderer = control.Parent as GestureRenderer;
         Element          element  = renderer.Element;
         Console.WriteLine("Control_ManipulationCompleted [" + control.Name + "] " + e.IsInertial);
         if (GestureMonitor != null)
         {
             GestureMonitor.RaiseEvent(element, new GestureMonitorEventArgs(element, GestureType.Swipe));
         }
     }
 }
        private void Slider_ManipulationCompleted(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
        {
            if (!isLoaded || isPivotItemLoading)
            {
                return;
            }

            ShowProgress();

            Slider item     = (sender as Slider);
            string deviceId = item.Tag.ToString();

            client.SetLevelAsync(Settings.CachedAuthenticationToken, deviceId, (int)item.Value);
        }
Example #4
0
        private void SportsGridAnteprima_ManipulationCompleted(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
        {
            var ct = (CompositeTransform)this.SportsGridAnteprima.RenderTransform;

            // Swipe Down-Up gesture < 0
            if (e.TotalManipulation.Translation.Y < 0)
            {
                double lr  = this.LayoutRoot.ActualHeight;
                double spa = this.SportsGridAnteprima.ActualHeight;
                ////System.Diagnostics.Debug.WriteLine("[DOWN-UP]\nLayoutRoot = " + lr + "\n" + "SportsGridAnteprima = " + spa + "\n" +
                ////    "Translation = " + e.TotalManipulation.Translation.Y + "\n" +
                ////    "PositionGridAnte = " + ((CompositeTransform)this.SportsGridAnteprima.RenderTransform).TranslateY);
                if (((CompositeTransform)this.SportsGridAnteprima.RenderTransform).TranslateY < 0)
                {
                    // traslazione della Grid nel bordo superiore dello schermo
                    ct.TranslateY = -(lr - spa);
                }
                else
                {
                    // traslazione della Grid in posizione 0  (Grid visibile e allineata con il bordo inferiore dello schermo)
                    ct.TranslateY = 0;
                }

                // In entrambi i casi la Grid è visibile.
                isGridUp = true;
            }
            // Swipe Up-Down gesture
            else if (e.TotalManipulation.Translation.Y > 0)
            {
                var lr  = this.LayoutRoot.ActualHeight;
                var spa = this.SportsGridAnteprima.ActualHeight;
                ////System.Diagnostics.Debug.WriteLine("[UP-DOWN]\nLayoutRoot = " + lr + "\n" + "SportsGridAnteprima = " + spa + "\n" +
                ////    "Translation = " + e.TotalManipulation.Translation.Y + "\n" +
                ////    "PositionGridAnte = " + ((CompositeTransform)this.SportsGridAnteprima.RenderTransform).TranslateY);
                if (((CompositeTransform)this.SportsGridAnteprima.RenderTransform).TranslateY < 0)
                {
                    // traslazione della Grid in posizione 0  (Grid visibile e allineata con il bordo inferiore dello schermo)
                    ct.TranslateY = 0;
                }
                else
                {
                    // traslazione della Grid in posizione iniziale (Grid semi nascosta con solo titolo visibile)
                    ct.TranslateY = initialPosition;
                    // solo in questo caso non è visibile
                    isGridUp = false;
                }
            }
            ////e.Handled = true;
        }
Example #5
0
        private void OnManipulationComPpleted(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
        {
            int userNum = new DirectionJudge().Direction(xDistance, yDistance);

            if (picTrue == userNum)
            {
                sum      += 10;
                Code.Text = sum.ToString();
                chang();
            }
            else
            {
                MessageBox.Show("得分:" + sum.ToString());
            }
        }
Example #6
0
 void svi_ManipulationCompleted(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
 {
     if (e.TotalManipulation.Translation.X > 30 || e.TotalManipulation.Translation.Y > 30)
     {
         Logger.Log("drag", String.Concat("gesture h:", e.TotalManipulation.Translation.X, " v:", e.TotalManipulation.Translation.Y));
     }
     if (e.TotalManipulation.Rotation > 3)
     {
         Logger.Log("rotate", String.Concat("gesture r:", e.TotalManipulation.Rotation));
     }
     if (e.TotalManipulation.Scale.Length != 1)
     {
         Logger.Log("resize", String.Concat("gesture ", e.TotalManipulation.Scale.Length));
     }
 }
Example #7
0
 private void ButtonUnlock_ManipulationCompleted(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
 {
     if (!swipeComplete)
     {
         ExtensibilityApp.EndUnlock();
         MainSnapBack.Begin();
     }
     else
     {
         if (!App.MainViewModel.HasPasscode)
         {
             SystemProtection.RequestScreenUnlock();
         }
     }
 }
        private bool validarRana(Ellipse elipse, System.Windows.Input.ManipulationCompletedEventArgs e)
        {
            double arriba    = Canvas.GetTop(ranaDibujo);
            double izquierda = Canvas.GetLeft(ranaDibujo);
            double ancho     = ranaDibujo.Width;
            double alto      = ranaDibujo.Height;
            double xElipse   = Canvas.GetLeft(elipse) + e.TotalManipulation.Translation.X;
            double yElipse   = Canvas.GetTop(elipse) + e.TotalManipulation.Translation.Y;

            if (xElipse > izquierda && xElipse < (izquierda + ancho) && yElipse > arriba && yElipse < (arriba + alto))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        void ImageContainer_ManipulationCompleted(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
        {
            var x  = e.TotalManipulation.Translation.X;
            var y  = e.TotalManipulation.Translation.Y;
            var sx = e.TotalManipulation.Scale.X;
            var sy = e.TotalManipulation.Scale.Y;

            if (Math.Abs(x) > Math.Abs(y) && sx == 0.0 && sy == 0.0)
            {
                if (x > 50.0 && currentIndex > 0)
                {
                    ShowPicture(currentIndex - 1);
                }
                else if (x < -50.0 && currentIndex + 1 < collection.Count)
                {
                    ShowPicture(currentIndex + 1);
                }
            }
        }
        private void Ellipse_ManipulationCompleted_1(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
        {
            Recursos re = new Recursos();
            //fondoPescado.Source = new BitmapImage(new Uri("imagenes/coloresPintados/fish3_color.png", UriKind.Relative));
            Ellipse elipse = sender as Ellipse;

            if (elipse.Name == "colorPelota" && validacionPelota(elipse, e) && !pintoPelota)
            {
                pelotaGato.Source = new BitmapImage(new Uri("../../imagenes/coloresPintados/cat2_color.png", UriKind.Relative));
                pintoPelota       = true;
                if (pintoGato == true)
                {
                    Botones.Begin();
                    Botones.Completed += Botones_Completed;
                    //re.TodoBien();
                }
                else
                {
                    re.Correcto();
                }
            }
            else if (elipse.Name == "colorGato" && validacionGato(elipse, e) && !pintoGato)
            {
                gato.Source = new BitmapImage(new Uri("../../imagenes/coloresPintados/cat1_color.png", UriKind.Relative));
                pintoGato   = true;
                if (pintoPelota == true)
                {
                    //re.TodoBien();
                    Botones.Begin();
                    Botones.Completed += Botones_Completed;
                }
                else
                {
                    re.Correcto();
                }
            }
            else
            {
                //Cuando es error
                re.Error();
            }
            elipse.RenderTransform = null;
        }
Example #11
0
 void ToastPrompt_ManipulationCompleted(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
 {
     if (e.TotalManipulation.Translation.X > 200 || e.FinalVelocities.LinearVelocity.X > 1000)
     {
         OnCompleted(new PopUpEventArgs <string, PopUpResult> {
             PopUpResult = PopUpResult.UserDismissed
         });
     }
     else if (e.TotalManipulation.Translation.X < 20)
     {
         OnCompleted(new PopUpEventArgs <string, PopUpResult> {
             PopUpResult = PopUpResult.Ok
         });
     }
     else
     {
         _translate.X = 0;
         StartTimer();
     }
 }
Example #12
0
        private void LuminositySlider_ManipulationCompleted(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
        {
            if (this.Tag == null)
            {
                return;
            }
            string ID;

            Cmd[] cmd      = (this.Tag as Eqlogic).cmds;
            Cmd   commande = cmd.GetCmd("luminosity_state");

            ID = cmd.GetCmd("luminosity").id;

            if (commande != null)// dans le cas des groupe de lumiere
            {
                commande.state = ((int)LuminositySlider.Value).ToString();
            }
            Outils.InvokeMethod("cmd::execCmd", ID, "slider", ((int)LuminositySlider.Value).ToString());

            UserControl_Loaded(sender, null);
        }
Example #13
0
        private void FinishMove(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
        {
            try
            {
                //Get parentListId
                var parentListId = ((TaskViewModel)DataContext).ParentList.id;

                //Check that atleast the parentListID and MovedId exist
                if (parentListId != "" && GTaskSettings.MovedId != "")
                {
                    //Make the call
                    MakeMove(parentListId, GTaskSettings.MovedId, GTaskSettings.PrevId);

                    //Reset Variables
                    GTaskSettings.MovedId = string.Empty;
                    GTaskSettings.PrevId  = string.Empty;
                }
            }
            catch (Exception)
            {
            }
        }
Example #14
0
 private void Choose(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
 {
     if (delta)
     {
         delta = false;
     }
     else
     {
         if (MessageBox.Show(UVEngine.Resources.UVEngine.confirmdelete, UVEngine.Resources.UVEngine.comfirminfo, MessageBoxButton.OKCancel) == MessageBoxResult.OK)
         {
             List.FileInfo IsFolder = (List.FileInfo)(sender as Grid).Tag;
             perfbar.IsIndeterminate = true;
             if (IsFolder.isFolder)
             {
                 this.Dispatcher.BeginInvoke(() =>
                 {
                     deleting = true;
                     DelFile(IsFolder.Name);
                     System.Threading.Thread.Sleep(1000);
                     list.ItemsSource = new List.FileList();
                     list.InvalidateArrange();
                     perfbar.IsIndeterminate = false;
                     deleting = false;
                 });
             }
             else
             {
                 this.Dispatcher.BeginInvoke(() =>
                 {
                     isf.DeleteFile(IsFolder.Name);
                     System.Threading.Thread.Sleep(1000);
                     list.ItemsSource = new List.FileList();
                     list.InvalidateArrange();
                     perfbar.IsIndeterminate = false;
                 });
             }
         }
     }
 }
Example #15
0
        void CalendarSelector_ManipulationCompleted(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
        {
            Point deltaPoint = e.TotalManipulation.Translation;

            if (Math.Abs(deltaPoint.X) < Math.Abs(deltaPoint.Y))
            {
                if (e.FinalVelocities.LinearVelocity.Y == 0)
                {
                    CalendarSelector.Opacity = 1;
                    return;
                }

                DateTime newDt;
                if (e.FinalVelocities.LinearVelocity.Y < 0)
                {
                    newDt           = CurrentCalendar.AddMonths(1);
                    CurrentCalendar = new DateTime(1, 1, 1);
                }
                else
                {
                    newDt           = CurrentCalendar.AddMonths(-1);
                    CurrentCalendar = new DateTime(1, 1, 1);
                }

                Storyboard       sb     = GetFadeIn(CalendarSelector);
                BackgroundWorker worker = new BackgroundWorker();
                worker.DoWork += (s, be) =>
                {
                    Dispatcher.BeginInvoke(() =>
                    {
                        LoadCalendar(newDt);
                        sb.SkipToFill();
                    });
                };
                worker.RunWorkerAsync();
                sb.Begin();
            }
        }
Example #16
0
        void rotation_Slider_ManipulationCompleted(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
        {
            var slider = sender as Slider;

            if (slider.Name[0] == 'x')//slider.Name.Contains("x"))
            {
                //xRotation_TextBlock.Text = "X Rotation: " + (int)slider.Value;
                xRotation_TextBox.Text = ((int)slider.Value).ToString();
                (renderingController.Components[0] as StlComponent).changeXRot((float)slider.Value);
            }
            else if (slider.Name[0] == 'y')//slider.Name.Contains("y"))
            {
                //yRotation_TextBlock.Text = "Y Rotation: " + (int)slider.Value;
                yRotation_TextBox.Text = ((int)slider.Value).ToString();
                (renderingController.Components[0] as StlComponent).changeYRot((float)slider.Value);
            }
            else
            {
                //zRotation_TextBlock.Text = "Z Rotation: " + (int)slider.Value;
                zRotation_TextBox.Text = ((int)slider.Value).ToString();
                (renderingController.Components[0] as StlComponent).changeZRot((float)slider.Value);
            }
        }
Example #17
0
        void uiElement_ManipulationCompleted(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
        {
            ManipulationEnds.Add(e.ManipulationOrigin);
            if (ManipulationStarts.Count == ManipulationEnds.Count)
            {
                if (ManipulationStarts.Count > 1)
                {
                    int startDistance = 0;
                    int endDistance   = 0;

                    //todo:get distance between first two start points.
                    //todo:get distance between first two end points.

                    if (startDistance > endDistance)
                    {
                        //todo:Pinch
                    }
                    else
                    {
                        //todo:Expand
                    }
                }
            }
        }
Example #18
0
 private void grid1_ManipulationCompleted(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
 {
     show = true;
     timer.Start();
 }
Example #19
0
 private void fieldGrid_ManipulationCompleted(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
 {
     manipulationHandler.ManipulationCompleted(e.TotalManipulation.Translation);
 }
Example #20
0
 private void StackPanel_ManipulationCompleted(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
 {
     (sender as StackPanel).Opacity = 1.0;
 }
 protected override void OnManipulationCompleted(System.Windows.Input.ManipulationCompletedEventArgs e)
 {
 }
 void slicer_Filelist_ManipulationCompleted(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
 {
     Timer updateStlTimer = new Timer(new TimerCallback(this.updateSlicerStl), null, 100, -1);
 }
Example #23
0
 private void OnManipulationCompleted(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
 {
     _pinching = false;
     _scale    = _coercedScale;
 }
 private void WitButton_ManipulationCompleted(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
 {
     VisualStateManager.GoToState(this, "Normal", false);
 }
Example #25
0
 private void rtbText_ManipulationCompleted(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
 {
 }
Example #26
0
        private void BoxExRenderer_ManipulationCompleted(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
        {
            var el = this.Element as BoxViewEx;

            el.OnManipulationCompleted(el, new PazzleDrag.ManipulationCompletedRoutedEventArgs());
        }
Example #27
0
 void GCode_Filelist_ManipulationCompleted(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
 {
     updateGocdeTimer = new Timer(new TimerCallback(this.updateGCode), null, 100, -1);
 }
Example #28
0
 private void Containter_ManipulationCompleted(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
 {
 }
Example #29
0
 private void CPSlider_ManipulationCompleted(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
 {
     //Timer deaktivieren
     Timer_Settings_Action = "none";
     Timer_Settings.Stop();
 }
Example #30
0
 private void viewport_ManipulationCompleted(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
 {
     m_Zoom = image.Width / m_Width;
 }