DynamicRenderer.RootVisual 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取 DynamicRenderer 的根 Visual。
public:
property System::Windows::Media::Visual ^ RootVisual { System::Windows::Media::Visual ^ get(); };
public System.Windows.Media.Visual RootVisual { get; }
member this.RootVisual : System.Windows.Media.Visual
Public ReadOnly Property RootVisual As Visual
属性值
示例
以下示例演示如何创建 DynamicRenderer 并将 添加到 RootVisualInkPresenter。 若要创建动态呈现墨迹的控件,请参阅 创建墨迹输入控件。
// Create a DrawingAttributes to use for the
// DynamicRenderer.
DrawingAttributes inkDA = new DrawingAttributes();
inkDA.Width = 5;
inkDA.Height = 5;
inkDA.Color = Colors.Purple;
// Add a dynamic renderer plugin that
// draws ink as it "flows" from the stylus
DynamicRenderer dynamicRenderer1 = new DynamicRenderer();
dynamicRenderer1.DrawingAttributes = inkDA;
this.StylusPlugIns.Add(dynamicRenderer1);
inkPresenter1.AttachVisuals(dynamicRenderer1.RootVisual,
dynamicRenderer1.DrawingAttributes);
' Create a DrawingAttributes to use for the
' DynamicRenderer.
Dim inkDA As New DrawingAttributes()
inkDA.Width = 5
inkDA.Height = 5
inkDA.Color = Colors.Purple
' Add a dynamic renderer plugin that
' draws ink as it "flows" from the stylus
Dim dynamicRenderer1 As New DynamicRenderer()
dynamicRenderer1.DrawingAttributes = inkDA
Me.StylusPlugIns.Add(dynamicRenderer1)
inkPresenter1.AttachVisuals(dynamicRenderer1.RootVisual, dynamicRenderer1.DrawingAttributes)
注解
使用 时, DynamicRenderer必须使用 方法将 RootVisual 属性附加到 InkPresenterAttachVisuals 。