void SubscribeEventsToChild(DependencyObject frameworkElement)
 {
     MultitouchScreen.AddGotContactCaptureHandler(frameworkElement, OnGotContactCapture);
     MultitouchScreen.AddLostContactCaptureHandler(frameworkElement, OnLostContactCapture);
     MultitouchScreen.AddNewContactHandler(frameworkElement, OnNewContact);
     MultitouchScreen.AddContactMovedHandler(frameworkElement, OnContactMoved);
     MultitouchScreen.AddContactRemovedHandler(frameworkElement, OnContactRemoved);
 }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        public InkCanvas()
        {
            MultitouchScreen.AddNewContactHandler(this, OnNewContact);
            MultitouchScreen.AddContactLeaveHandler(this, OnContactLeave);
            MultitouchScreen.AddContactMovedHandler(this, OnContactMove);

            inkCanvas = new System.Windows.Controls.InkCanvas();
            key       = new object();
            DefaultDrawingAttributes = new DrawingAttributes();
            Strokes = new StrokeCollection();

            BindToInkCanvas(BackgroundProperty);
            BindToInkCanvas(DefaultDrawingAttributesProperty);
            BindToInkCanvas(EditingModeProperty);
            BindToInkCanvas(StrokesProperty);

            inkCanvas.DefaultDrawingAttributesReplaced += OnDefaultDrawingAttributesReplaced;
            inkCanvas.StrokeErasing   += OnStrokeErasing;
            inkCanvas.StrokesReplaced += OnStrokesReplaced;
            inkCanvas.StrokeCollected += OnCollected;
        }