Exemplo n.º 1
0
        private void BindToInkCanvas(DependencyProperty property)
        {
            Binding binding = new Binding();

            binding.Source = this;
            binding.Path   = new PropertyPath(property.Name);
            inkCanvas.SetBinding(property, binding);
        }
Exemplo n.º 2
0
      /// <summary/>
      protected override void OnInitialized(EventArgs e) {
         base.OnInitialized(e);

         _inkCanvas = new InkCanvas();
         _inkCanvas.SetBinding(InkCanvas.BackgroundProperty, this, "Background");
         _inkCanvas.SetBinding(InkCanvas.DefaultDrawingAttributesProperty, this, "StylusAttributes");
         _inkCanvas.EditingMode = InkCanvasEditingMode.GestureOnly;
         _inkCanvas.Gesture += _onGestureRecognition;

         IsGestureRecognizerAvailable = _inkCanvas.IsGestureRecognizerAvailable;
         _systemGestures = new HashSet<ApplicationGesture>(new[] {
            ApplicationGesture.Curlicue
         });
         SystemGestures = _systemGestures;
         _updateEnabledGestures();

         AddVisualChild(_inkCanvas);
      }