/// <summary> /// Unwires the sketch events from this Design Surface. /// </summary> /// <param name="sketch">The <c>KimonoSketch</c> to remove events from.</param> private void UnwireSketchEvents(KimonoSketch sketch) { // Wireup sketch events to the design surface sketch.RequestNewUndoPoint -= SaveUndoPoint; sketch.ImageBufferNeedsRefresh -= RefreshView; sketch.SketchSizeChanged -= RaiseSketchSizeChanged; sketch.SketchModified -= RaiseSketchModified; sketch.SelectedShapeModified -= RaiseSelectedShapeModified; sketch.SelectionChanged -= RaiseSelectionChanged; sketch.ToolChanged -= RaiseToolChanged; }
/// <summary> /// Handles the currently selected sketch changing. /// </summary> /// <param name="sketch">The new <c>KimonoSketch</c> being selected.</param> private void HandleSketchChanging(KimonoSketch sketch) { // Wireup events for the selected sketch WireUpSketchEvents(sketch); // Redraw interface RefreshView(); // Fire events to reset UI RaiseToolChanged(Tool); RaiseSketchModified(); RaiseSelectionChanged(SelectedShape); }