Exemple #1
0
      // detaches the projection from the given target element
      private void _dettach(FrameworkElement target) {
         if (_target != target) {
            throw new InvalidOperationException();
         }
         _target.SizeChanged -= _onTargetSizeChanged;
         _target.Effect = null;
         _target = null;
         _effect = null;

      }
Exemple #2
0
      // attaches the projection to the given target element
      private void _attach(FrameworkElement target) {
         _target = target;
         _effect = new PlaneProjectionEffect() { RecenterViewport = true };
         _target.Effect = _effect;

         _scaleTransform = new ScaleTransform();
         _translateTransform = new TranslateTransform();
         _target.RenderTransformOrigin = new Point(0.5, 0.5);
         _target.RenderTransform = new TransformGroup { Children = { _scaleTransform, _translateTransform } };
         _target.SizeChanged += _onTargetSizeChanged;
         _updateRenderSize();

      }