InkPresenter.DetachVisuals(Visual) メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
DynamicRendererから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)
パラメーター
- visual
- Visual
デタッチする DynamicRenderer のビジュアル。
例外
visual が InkPresenterにアタッチされていません。
例
次の例では、変更のDynamicRendererが発生するたびに、InkPresenterのビジュアルをDrawingAttributesに再アタッチします。 この例では、 AttributeChanged イベントがイベント ハンドラーにアタッチされていることを前提としています。
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
注釈
カスタム コントロールの DrawingAttributes が変更されたら、 DynamicRenderer のビジュアルを InkPresenterに再アタッチする必要があります。 DetachVisualsメソッドとAttachVisuals メソッドを呼び出して、ビジュアルをInkPresenterに再アタッチします。