Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

InkPresenter.DetachVisuals Method

Detaches the visual of the DynamicRenderer from the InkPresenter.

Namespace:  System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

public void DetachVisuals(
	Visual visual
)

Parameters

visual
Type: System.Windows.Media.Visual

The visual of the DynamicRenderer to detach.

ExceptionCondition
InvalidOperationException

visual is not attached to the InkPresenter.

When the DrawingAttributes on a custom control changes, the visual of the DynamicRenderer must be re-attached to the InkPresenter. Call the DetachVisuals and AttachVisuals methods to re-attach the visual to the InkPresenter.

The following example re-attaches the visual of a DynamicRenderer to the InkPresenter whenever the DrawingAttributes on the changes. This example assumes that the AttributeChanged event is attached to the event handler.

void DrawingAttributesChanged(object sender, PropertyDataChangedEventArgs e)
{
    // Reattach the visual of the DynamicRenderer to the InkPresenter  
    // whenever the DrawingAttributes change.
    presenter.DetachVisuals(renderer.RootVisual);
    presenter.AttachVisuals(renderer.RootVisual, renderer.DrawingAttributes);

}

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

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.

Show:
© 2014 Microsoft