InkCanvas.StrokesReplaced Event
Occurs when the Strokes property is replaced.
Assembly: PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
The following example demonstrates how to use two StrokeCollection objects that are co-located on the same InkCanvas. In this example, player one and player two each use an individual "inking surface" even though they share the same InkCanvas. This example assumes that the switchPlayersButton_Click event is connected to the event handler.
StrokeCollection player1; StrokeCollection player2; void InitializePlayersCanvases() { player1 = inkCanvas1.Strokes; player2 = new StrokeCollection(); } // Use a different "inking surface" for each player. void switchPlayersButton_Click(object sender, RoutedEventArgs e) { if (StrokeCollection.ReferenceEquals(inkCanvas1.Strokes, player1)) { inkCanvas1.Strokes = player2; } else { inkCanvas1.Strokes = player1; } } void inkCanvas1_StrokesReplaced(object sender, InkCanvasStrokesReplacedEventArgs e) { if (StrokeCollection.ReferenceEquals(e.NewStrokes, player1)) { Title = "Player one's turn"; } else { Title = "Player two's turn"; } }
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.