Files
docs-desktop/dotnet-desktop-guide/framework/wpf/advanced/how-to-data-bind-to-an-inkcanvas.md
T
Andy De George da363692ff Initial WPF content migrated (#17)
* Reset branch for WPF changes

* Convert BMP to PNG; fix link-out-of-scope err

* Add snippets for WPF... 6794 files!!!!

* Add missing snippets

* update file updated between migration

* Fix paths to include

* update breadcrumb and toc

* fix index links

* fix index links

* fix index links

* fix markdown
2020-09-04 09:46:28 -07:00

2.0 KiB

title, ms.date, helpviewer_keywords, ms.assetid
title ms.date helpviewer_keywords ms.assetid
How to: Data Bind to an InkCanvas 03/30/2017
InkCanvas [WPF], binding data to
binding data [WPF], to InkCanvas
8d6b4d9e-ea7f-4412-ba83-3feccec5a515

How to: Data Bind to an InkCanvas

Example

The following example demonstrates how to bind the xref:System.Windows.Controls.InkCanvas.Strokes%2A property of an xref:System.Windows.Controls.InkCanvas to another xref:System.Windows.Controls.InkCanvas.

[!code-xamlInkCanvasBindingSnippet#2]

The following example demonstrates how to bind the xref:System.Windows.Controls.InkCanvas.DefaultDrawingAttributes%2A property to a data source.

[!code-xamlInkCanvasBindingSnippet#3]
[!code-xamlInkCanvasBindingSnippet#4]

The following example declares two xref:System.Windows.Controls.InkCanvas objects in XAML and establishes data binding between them and other data sources. The first xref:System.Windows.Controls.InkCanvas, called ic, is bound to two data sources. The xref:System.Windows.Controls.InkCanvas.EditingMode%2A and xref:System.Windows.Controls.InkCanvas.DefaultDrawingAttributes%2A properties on ic are bound to xref:System.Windows.Controls.ListBox objects, which are in turn bound to arrays defined in the XAML. The xref:System.Windows.Controls.InkCanvas.EditingMode%2A, xref:System.Windows.Controls.InkCanvas.DefaultDrawingAttributes%2A, and xref:System.Windows.Controls.InkCanvas.Strokes%2A properties of the second xref:System.Windows.Controls.InkCanvas are bound to the first xref:System.Windows.Controls.InkCanvas, ic.

[!code-xamlInkCanvasBindingSnippet#1]