Clone Method

StrokeCollection.Clone Method

Copies the StrokeCollection.

Namespace:  System.Windows.Ink
Assembly:  PresentationCore (in PresentationCore.dll)

public virtual StrokeCollection Clone()
You cannot use methods in XAML.

The Clone method copies each Stroke in the collection and the new StrokeCollection references the new strokes.

The following example demonstrates how to copy the ink in one InkCanvas onto another InkCanvas. This example assumes:

  • There are two InkCanvas objects called inkCanvas1 and inkCanvas2.

  • The Click event has been connected to the event handler.

// Copy the strokes from one InkCanvas to another InkCanvas. 
private void CopyStrokes_Click(object sender, RoutedEventArgs e) 
    StrokeCollection strokes = inkCanvas1.Strokes.Clone();


Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0

Community Additions

© 2016 Microsoft