WPF 图层控制
我需要一个 WPF 图层控件来执行以下操作
1) 将多个内容层相互叠加。
2) 能够在设计和运行时打开/关闭图层,即我们需要一个 UI,可能类似于选项卡式控件
3) 在堆栈中向上/向下移动图层
4) 更改图层的不透明度
现在我知道以上所有内容都可以在Xaml/WPF。 我使用网格编写了一个简单的版本,在设计时有多个单元,1 个单元 = 1 层,在运行时只有一个单元,所有单元都合并为一个。 问题是,这是一个拼凑,没有给我所需的设计时控件,所有控件最终都有一个父控件,丑陋。 任何人都可以获得现成的或部分工作的示例 - 如果没有,我将编写一个合适的代码并在 CodePlex 上分享。
我确信我不是唯一需要此功能的人,不是吗?
I'm in need of a WPF layer control that does the following
1) Have multiple layers of content on top of each other.
2) Ability to turn layers on/off at design and runtime, ie we need a UI maybe something like a tabbed control
3) Move layers up/down the stack
4) Change opacity for layers
Now I know all of the above is possible in Xaml/WPF. I've coded up a simple version using a grid, that has mutiple cells at design time, 1 cell = 1 layer, and only a single cell at runtime, all the cells are merged into one. Thing is that was a kludge, didn't give me the design time control that I needed, all controls end up with a single parent, ugly. Anyone got an off the shelf, or part working example - if not I'll code up a proper one and share it on CodePlex.
I'm sure I'm not the only person out there who needs this functionality, am I?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于我之前的客户,我们使用 Canvas 完成了这一任务。 该应用程序本质上是一个“CAD”,因此我们的图层负责域的图形表示。
目前我不知道有任何第三方工具可以完成此任务。
我认为这样做的原因是,当您寻找此功能时,它是特定于域和领域的。 应用。
如果您要构建自己的控件,我会鼓励构建一个自定义控件来管理逻辑,然后允许其他人设计外观和感觉。 这将更多地是解决问题的 Wpf 方式。
这样,如果 1 个消费者想要使用画布,他们就可以。 如果您想使用网格,那么您也可以。
如果您有任何想要执行的伪代码,我可以看看是否可以修改我的旧 POC 来满足您的需求。 或者,如果您想启动 CodePlex 项目,我不介意做出贡献。
这只是我的2分钱。
With my previous client we accomplished this using Canvases. The application was a 'CAD' like in nature so our layers were responsible for graphical representations of the domain.
I do not know of any 3rd party tools that accomplish this at the moment.
I think the reasoning for this is that when you are looking for this functionality it is very specific to the domain & application.
If you were going to build your own control I would encourage building a custom control for managing the logic, then allow others to style the look and feel. It would be more of the Wpf way of approaching the problem.
In that way if 1 consumer wants to use canvases they could. If you wanted to use a grid, then you could as well.
If you have any psuedo code of what you would like to do, I can see if any of my old POCs can be modified to meet your needs. Or if you want to start a CodePlex project I wouldn't mind contributing.
That's just my 2 cents.