InkCanvas 控件模板
我希望移动 InkCanvas 中的 InkPresenter,使其 ZIndex 低于 InkCanvas 的子级。
换句话说,我想移动 Ink,以便它显示在作为子项添加到 InkCanvas 的图像和用户控件下。
我想知道是否有办法编辑 InkCanvas 的控制模板来实现此目的?我完全没有成功地完成这项任务。
最初,我使用 InkCanvas 作为一层,并将子级放置到 InkCanvas 顶部的 Canvas 控件中;但是,我希望能够一起选择子项和笔画...因为 InkCanvas 内置了此功能,所以我希望不要使用这样的 2 个控件。
谢谢。
-弗林尼
I am looking to move the InkPresenter in the InkCanvas to have a ZIndex that is lower than the Children of the InkCanvas.
In other words, I want to move the Ink so that it is displayed under the images and user controls that are added to the InkCanvas as Children.
I was wondering if there is a way to edit the Control Template of the InkCanvas to achieve this? I have been completely unsuccessful at accomplishing this task.
Originally I was using the InkCanvas as one layer and placed the children into a Canvas control that is on top of the InkCanvas; however, I want to be able to select the Children and the Strokes together...since the InkCanvas has this built in I was hoping to not use 2 controls like this.
Thanks.
-Frinny
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不相信我最初想做的事情(将 InkPresenter 移到 Childeren 下)是可能的。
我最终使用了一个 Grid 控件,其中包含 2 个同级 InkCanvas 控件。一个 InkCanvas 严格用于墨迹笔划,另一个用于所有子对象。然后,我可以设置控件的 ZIndex,以便墨水显示在对象控件下。我必须根据用户是否使用对象或墨迹笔划来管理 InkCanavas 控件的 IsHitTestVisible 属性。
我还考虑过将子项添加到 InkCanvas 的 Adorner 层,但决定改为使用 2 个 InkCanvas 控件。
-弗林尼
I don't believe that what I was originally trying to do (move the InkPresenter under the Childeren) was possible.
I ended up using a Grid control with 2 sibling InkCanvas controls within it. One InkCanvas is strictly used for the ink strokes and the other is used for all of the children objects. I was then able to set the ZIndex of the controls so that the ink was displayed under the object controls. I had to manage the IsHitTestVisible property of the InkCanavas controls depending on whether the user was working with Objects or ink strokes.
I also considered adding the children to the Adorner layer of the InkCanvas but decided to go with using 2 InkCanvas controls instead.
-Frinny