StrokeCollection.Add(StrokeCollection) Metod
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Lägger till de angivna linjerna i StrokeCollection.
public:
void Add(System::Windows::Ink::StrokeCollection ^ strokes);
public void Add(System.Windows.Ink.StrokeCollection strokes);
override this.Add : System.Windows.Ink.StrokeCollection -> unit
Public Sub Add (strokes As StrokeCollection)
Parametrar
- strokes
- StrokeCollection
Att StrokeCollection lägga till i samlingen.
Undantag
En Stroke in strokes är redan medlem i StrokeCollection.
strokes är null.
Exempel
I följande exempel visas hur du kopierar pennanteckningen i ett till ett InkCanvas annat InkCanvas. Det här exemplet förutsätter:
Det finns två InkCanvas objekt som heter
inkCanvas1ochinkCanvas2.Händelsen Click har anslutits till händelsehanteraren.
// Copy the strokes from one InkCanvas to another InkCanvas.
private void CopyStrokes_Click(object sender, RoutedEventArgs e)
{
StrokeCollection strokes = inkCanvas1.Strokes.Clone();
inkCanvas2.Strokes.Clear();
inkCanvas2.Strokes.Add(strokes);
}
' Copy the strokes from one InkCanvas to another InkCanvas.
Private Sub CopyStrokes_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
Dim strokes As StrokeCollection = inkCanvas1.Strokes.Clone()
inkCanvas2.Strokes.Clear()
inkCanvas2.Strokes.Add(strokes)
End Sub
Kommentarer
Metoden Add genererar StrokesChanged händelsen.