Silverlight 工具包 - 多个 ChildWindows 和背景
当我从 SL Toolkit 打开 ChildWindow 时,周围区域变成漂亮的灰色。但是,如果我的 ChildWindow 本身生成了一个新的 ChildWindow,则周围区域会变成深灰色,无限,直到我的外部区域变成乌黑。
有没有办法让每个新的 ChildWindow 弹出,周围区域与第一个子窗口相同的浅灰色?我不想完全关闭此效果,因为我仍然希望之前的 Childwindow 变灰;我只是不想让它被黑。
在查看这个问题时,我得到了印象是我想要的东西是不可能的。提供灰色背景的覆盖网格的不透明度介于 0 和 1 之间,这就是每个新覆盖层都会添加到前一个覆盖层的原因。不透明度为 1 可以防止这种变黑,但您将无法看到在弹出 ChildWindow 之前打开的内容。
还有其他巧妙的方法来实现这一目标吗?
When I open a ChildWindow from the SL Toolkit, the surrounding area turns a nice gray. But, if my ChildWindow itself spawns a new ChildWindow, then the surrounding area turns a darker gray, ad infinitum until my outside area is jet black.
Is there a way to have each new ChildWindow pop up with the surrounding area the same light gray as the first one? I don't want to turn off this effect altogether since I still want the previous Childwindow to be grayed out; I just don't want it to be blackened.
In looking at this question I get the impression that what I want is impossible. The overlay grid that supplies the gray background has an opacity between 0 and 1, which is why each new overlay adds to the previous. An Opacity of 1 would prevent this blackening, but you wouldn't be able to see what was open before the ChildWindow was popped up.
Is there any other slick way to achieve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
假设您有 child1 和 child2,并且 child1 打开 child2。当child1打开child2时,您可以将child1覆盖层的不透明度设置为0。然后,当child2关闭时,将child1覆盖层的不透明度设置为默认值。
Let's say you have child1 and child2 and child1 opens child2. When child1 opens child2, you could set the opacity of child1's overlay to 0. Then, when child2 closes, you set the opacity of child1's overlay to the default value.
子窗口有两个属性,您可以调整它们以获得所需的叠加层:
OverlayBrush
和OverlayOpacity
。The child window has two properties that you can tweak to get your desirable overlay which are:
OverlayBrush
andOverlayOpacity
.