Example #1
0
        public CanvasView()
        {
            backCanvas = new Canvas();
            Children.Add(backCanvas);

            inkCanvas = new InkCanvas()
            {
                Background = new System.Windows.Media.SolidColorBrush(),
                DefaultDrawingAttributes = new System.Windows.Ink.DrawingAttributes()
                {
                    StylusTip = System.Windows.Ink.StylusTip.Ellipse,
                    Height    = 3,
                    Width     = 3
                }
            };
            inkCanvas.SetBinding(FrameworkElement.WidthProperty, new System.Windows.Data.Binding("ActualWidth")
            {
                Source = backCanvas
            });
            inkCanvas.SetBinding(FrameworkElement.HeightProperty, new System.Windows.Data.Binding("ActualHeight")
            {
                Source = backCanvas
            });
            backCanvas.Children.Add(inkCanvas);
        }