InkPresenter.DetachVisuals(Visual) Metoda

Definice

Oddělí vizuál DynamicRenderer od InkPresenter.

public:
 void DetachVisuals(System::Windows::Media::Visual ^ visual);
public void DetachVisuals (System.Windows.Media.Visual visual);
member this.DetachVisuals : System.Windows.Media.Visual -> unit
Public Sub DetachVisuals (visual As Visual)

Parametry

visual
Visual

Vizuál DynamicRenderer pro odpojení.

Výjimky

visual není připojen k InkPresenter.

Příklady

V následujícím příkladu se vizuál DynamicRenderer znovu připojí k hodnotě InkPresenter , kdykoli se DrawingAttributes změní . Tento příklad předpokládá, že AttributeChanged událost je připojena k obslužné rutině události.

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);
}
Private Sub DrawingAttributesChanged(ByVal sender As Object, ByVal e As PropertyDataChangedEventArgs)

    ' Reattach the visual of the DynamicRenderer to the InkPresenter 
    ' whenever the DrawingAttributes change.
    presenter.DetachVisuals(renderer.RootVisual)
    presenter.AttachVisuals(renderer.RootVisual, renderer.DrawingAttributes)

End Sub

Poznámky

Když se DrawingAttributes u vlastního DynamicRenderer ovládacího prvku změní, musí se vizuál znovu připojit k InkPresenter. Voláním DetachVisuals metod a AttachVisuals znovu připojte vizuál k objektu InkPresenter.

Platí pro