Is it good practice to position UIElements via RenderTransform

落花浮王杯 提交于 2019-12-12 04:32:52

问题


In my WPF application I have a control that acts like a zoom box. You can zoom and drag its content. In my case this content is a grid that contains an image and some UserControls. These UserControls have to be positioned ontop of the image to highlight some segments of that image.

Here is an example (this is not an actual use case):

My question is, how should I position those red rectangles (what is the better practise here)?

  1. By replacing the grid with a canvas and use Canvas.SetLeft resp. Canvas.SetTop?

or

  1. By manipulating the RenderTransform of those rectangles?

Note: The rectangles are interactive (they have to interact with the mouse and maybe some other input devices).

来源:https://stackoverflow.com/questions/45208505/is-it-good-practice-to-position-uielements-via-rendertransform

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!