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.
Private player1 As StrokeCollection Private player2 As StrokeCollection Sub InitializePlayersCanvases() player1 = inkCanvas1.Strokes player2 = New StrokeCollection() End Sub 'InitializePlayersCanvases ' Use a different "inking surface" for each player. Private Sub switchPlayersButton_Click(ByVal sender As Object, ByVal e As RoutedEventArgs) If StrokeCollection.ReferenceEquals(inkCanvas1.Strokes, player1) Then inkCanvas1.Strokes = player2 Else inkCanvas1.Strokes = player1 End If End Sub 'switchPlayersButton_Click Private Sub inkCanvas1_StrokesReplaced(ByVal sender As Object, _ ByVal e As InkCanvasStrokesReplacedEventArgs) If StrokeCollection.ReferenceEquals(e.NewStrokes, player1) Then Title = "Player one's turn" Else Title = "Player two's turn" End If End Sub 'inkCanvas1_StrokesReplaced
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.