Пример #1
0
        public void createShadow(Point fromInkableScene)
        {
            InkableScene inkableScene = MainViewController.Instance.InkableScene;

            if (inkableScene != null && DataContext != null)
            {
                _currentFromInkableScene = fromInkableScene;
                _shadow             = new AttributeGroupView();
                _shadow.DataContext = new InputGroupViewModel()
                {
                    AttributeOperationModel = (DataContext as InputGroupViewModel).AttributeOperationModel,
                    IsShadow = true
                };


                _shadow.Measure(new Size(double.PositiveInfinity,
                                         double.PositiveInfinity));

                _shadow.Width  = this.ActualWidth;
                _shadow.Height = _shadow.DesiredSize.Height;

                _shadow.RenderTransform = new TranslateTransform()
                {
                    X = fromInkableScene.X - _shadow.Width / 2.0,
                    Y = fromInkableScene.Y - _shadow.Height
                };


                inkableScene.Add(_shadow);
                _shadow.SendToFront();

                Rct bounds = _shadow.GetBounds(inkableScene);
                (DataContext as InputGroupViewModel).FireMoved(bounds, (DataContext as InputGroupViewModel).AttributeOperationModel);
            }
        }
Пример #2
0
        void mainPointerManager_Removed(object sender, PointerManagerEvent e)
        {
            if (_shadow == null &&
                _manipulationStartTime + TimeSpan.FromSeconds(0.5).Ticks > DateTime.Now.Ticks)
            {
                // tapp
            }

            if (_shadow != null)
            {
                InkableScene inkableScene = MainViewController.Instance.InkableScene;

                Rct bounds = _shadow.GetBounds(inkableScene);
                (DataContext as InputGroupViewModel).FireDropped(bounds, (DataContext as InputGroupViewModel).AttributeOperationModel);

                inkableScene.Remove(_shadow);
                _shadow = null;
            }

            _manipulationStartTime = 0;
        }