//<Snippet3> // Accepts a string that contains ink data in ink // serialized format (ISF) and converts it into a StrokeCollection. public void LoadStrokes() { StrokeCollectionConverter converter = new StrokeCollectionConverter(); if (converter.CanConvertFrom(typeof(string))) { StrokeCollection newStrokes = (StrokeCollection)converter.ConvertFrom(null, null, strokesString); presenter.Strokes.Clear(); presenter.Strokes.Add(newStrokes); } }
public InkEraser() { presenter = new InkPresenter(); this.Content = presenter; // Create a StrokeCollection the string and add it to StrokeCollectionConverter converter = new StrokeCollectionConverter(); if (converter.CanConvertFrom(typeof(string))) { StrokeCollection newStrokes = converter.ConvertFrom(strokesString) as StrokeCollection; presenter.Strokes.Clear(); presenter.Strokes.Add(newStrokes); } }