--- title: "How to: Data Bind to an InkCanvas" ms.date: "03/30/2017" helpviewer_keywords: - "InkCanvas [WPF], binding data to" - "binding data [WPF], to InkCanvas" ms.assetid: 8d6b4d9e-ea7f-4412-ba83-3feccec5a515 --- # How to: Data Bind to an InkCanvas ## Example The following example demonstrates how to bind the property of an to another . [!code-xaml[InkCanvasBindingSnippet#2](~/samples/snippets/csharp/VS_Snippets_Wpf/InkCanvasBindingSnippet/CS/Window2.xaml#2)] The following example demonstrates how to bind the property to a data source. [!code-xaml[InkCanvasBindingSnippet#3](~/samples/snippets/csharp/VS_Snippets_Wpf/InkCanvasBindingSnippet/CS/Window2.xaml#3)] [!code-xaml[InkCanvasBindingSnippet#4](~/samples/snippets/csharp/VS_Snippets_Wpf/InkCanvasBindingSnippet/CS/Window2.xaml#4)] The following example declares two objects in XAML and establishes data binding between them and other data sources. The first , called `ic`, is bound to two data sources. The and properties on `ic` are bound to objects, which are in turn bound to arrays defined in the XAML. The , , and properties of the second are bound to the first , `ic`. [!code-xaml[InkCanvasBindingSnippet#1](~/samples/snippets/csharp/VS_Snippets_Wpf/InkCanvasBindingSnippet/CS/Window1.xaml#1)]