Esempio n. 1
0
 void elem_MLManipulationDelta(object sender, MLManipulationArgs args)
 {
     if (_pointers > 1)
     {
         this.Opacity = 0.0;
         _elementtransform.TranslateX += args.X;
         _elementtransform.TranslateY += args.Y;
         _elementtransform.ScaleX     *= args.Scale;
         _elementtransform.ScaleY     *= args.Scale;
         _elementtransform.Rotation   += args.Rotate;
     }
     else
     {
         if (_currentposition < _initthreshold && _currentposition > _finalthreshold)
         {
             delta_proportion = 1.0;
         }
         else
         {
             delta_proportion = 0.4;
         }
         _currentposition      += (args.X * delta_proportion);
         _page_translation     += (args.X * delta_proportion);
         _ctrasnform.TranslateX = _currentposition;
     }
 }
 void page_MLManipulationDelta(object sender, MLManipulationArgs args)
 {
     MLManipulationDelta(sender, args);
 }
Esempio n. 3
0
 void _manipulablescroll_MLManipulationDelta(object sender, MLManipulationArgs args)
 {
     MLManipulationDelta(sender, args);
 }
        void ManipulableScroll_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
        {
            if (_ismanipulationenable)
            {
                if (_pointers < 2)
                {
                    if (!_deltatested)
                    {
                        if (Math.Abs(e.Delta.Translation.X) < Math.Abs(e.Delta.Translation.Y))
                        {
                            _deltatested = true; _isvertical = true;
                            if (MLManipulationCompleted != null)
                            {
                                MLManipulationCompleted(this, -1);
                            }
                        }
                        else
                        {
                            _deltatested = true; _ishorizontal = true;
                        }
                    }

                    if (_isvertical)
                    {
                        _actualdelta += e.Delta.Translation.Y;
                        if (_actualdelta > _threshold && _actualdelta < 0.0)
                        {
                            ThresholdDelta += e.Delta.Translation.Y;
                        }
                        else
                        {
                            TranslateDelta += e.Delta.Translation.Y;
                        }
                        _paneltransform.TranslateY = _currenttranslate + TranslateDelta;
                    }
                    else
                    //if (_ishorizontal)
                    {
                        //if(MLManipulationDelta!=null)
                        //{
                        var args_1 = new MLManipulationArgs()
                        {
                            X      = e.Delta.Translation.X,
                            Y      = e.Delta.Translation.Y,
                            Scale  = e.Delta.Scale,
                            Rotate = e.Delta.Rotation
                        };
                        MLManipulationDelta(this, args_1);
                        //}
                    }
                }
                else
                {
                    //if (MLManipulationDelta != null)
                    //{
                    var args_1 = new MLManipulationArgs()
                    {
                        X      = e.Delta.Translation.X,
                        Y      = e.Delta.Translation.Y,
                        Scale  = e.Delta.Scale,
                        Rotate = e.Delta.Rotation
                    };
                    MLManipulationDelta(this, args_1);
                    //}
                }
            }

            if (e.IsInertial) //(_forcemanipulation2end || (e.IsInertial && TranslateDelta != 0.0))
            {
                e.Complete();
            }
        }
        void ManipulableScroll_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
        { 
            if (_ismanipulationenable)
                if (_pointers < 2)
                {
                    if (!_deltatested)
                        if (Math.Abs(e.Delta.Translation.X ) < Math.Abs(e.Delta.Translation.Y))
                        {
                            _deltatested = true; _isvertical = true;
                            if (MLManipulationCompleted != null) MLManipulationCompleted(this, -1);
                        }
                        else
                        { _deltatested = true; _ishorizontal = true; }

                    if (_isvertical)
                    {
                        _actualdelta += e.Delta.Translation.Y;
                        if (_actualdelta > _threshold && _actualdelta < 0.0)
                            ThresholdDelta += e.Delta.Translation.Y;
                        else TranslateDelta += e.Delta.Translation.Y;
                        _paneltransform.TranslateY = _currenttranslate + TranslateDelta;
                    }
                    else
                    //if (_ishorizontal)
                    {
                        //if(MLManipulationDelta!=null)
                        //{
                            var args_1 = new MLManipulationArgs() { 
                                X=e.Delta.Translation.X,
                                Y =e.Delta.Translation.Y,
                                Scale = e.Delta.Scale ,
                                Rotate = e.Delta.Rotation
                            };
                            MLManipulationDelta(this, args_1);
                        //}
                    }  
                    
                }
                else
                {
                    //if (MLManipulationDelta != null)
                    //{
                        var args_1 = new MLManipulationArgs()
                        {
                            X = e.Delta.Translation.X,
                            Y = e.Delta.Translation.Y,
                            Scale = e.Delta.Scale,
                            Rotate = e.Delta.Rotation
                        };
                        MLManipulationDelta(this, args_1);
                    //}
                }

            if(e.IsInertial) //(_forcemanipulation2end || (e.IsInertial && TranslateDelta != 0.0))
            {
                e.Complete();
            }
        }
 void elem_MLManipulationDelta(object sender, MLManipulationArgs args)
 {
     if (_pointers > 1)
     {
         this.Opacity = 0.0;
         _elementtransform.TranslateX += args.X;
         _elementtransform.TranslateY += args.Y;
         _elementtransform.ScaleX *= args.Scale;
         _elementtransform.ScaleY *= args.Scale;
         _elementtransform.Rotation += args.Rotate;
     }
     else
     {
         if (_currentposition < _initthreshold && _currentposition > _finalthreshold) { delta_proportion = 1.0; }
         else { delta_proportion = 0.4; }
         _currentposition += (args.X * delta_proportion);
         _page_translation += (args.X * delta_proportion);
         _ctrasnform.TranslateX = _currentposition; 
     }
 }
 void page_MLManipulationDelta(object sender, MLManipulationArgs args)
 {
     MLManipulationDelta(sender, args);
 }
Esempio n. 8
0
 void _manipulablescroll_MLManipulationDelta(object sender, MLManipulationArgs args)
 {
     MLManipulationDelta(sender, args);
 }