如何将一个物体隐藏在另一个物体后面?

发布于 2024-12-27 19:07:42 字数 125 浏览 3 评论 0原文

我正在尝试使用 Expression Blend 为我的按钮制作故事板。 我希望它移动,然后消失在某个虚拟面板后面。 我想我可以通过为按钮定义一个“可见区域”来做到这一点,这样当它移出该区域时,它就会被隐藏。是否可以 ? 感谢您的帮助。

I am trying to make a storyboard for my button with Expression Blend.
I would like it to move, and then to disapear behind some virtual panel.
I think I could do it by defining an "area of visibility" for my button, so when it moves out of that area, it is hidden. Is it possible ?
Thanks for your help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

兰花执着 2025-01-03 19:07:42

请参阅 Blend 中“属性”选项卡上的 ZIndex 属性

see ZIndex property on the Properties tab in Blend

海拔太高太耀眼 2025-01-03 19:07:42

听起来您希望按钮在滑入 GUI 中的隐形插槽时消失。如果是这种情况,您的解决方案将处理剪辑区域的动画,使其逐渐变大,直到覆盖您的按钮。我几乎可以肯定这需要在代码中而不是 XAML 中。在动画结束时,您可以简单地将可见性设置为隐藏/折叠,然后完全删除剪切区域。

It sounds like you want your button to disappear as it were sliding into an invisible slot in your GUI. If that's the case, your solution will deal with animating a clipping region to make it progressively bigger until it covers your button. I'm almost certain this needs to be in code and not XAML though. At the end of the animation you can simply set the visibility to hidden/collapsed and then remove the clipping region entirely.

灯角 2025-01-03 19:07:42

您是否尝试过使用 Opacity 属性?

DoubleAnimation fade = new DoubleAnimation();
fade.From = 1d;
fade.To = 0d;
fade.Duration = new Duration(new TimeSpan(0, 0, 1));

Storyboard.SetTargetName(fade, this.Name);
Storyboard.SetTargetProperty(fade, new PropertyPath(UIElement.OpacityProperty));

Have you tried using the Opacity property?

DoubleAnimation fade = new DoubleAnimation();
fade.From = 1d;
fade.To = 0d;
fade.Duration = new Duration(new TimeSpan(0, 0, 1));

Storyboard.SetTargetName(fade, this.Name);
Storyboard.SetTargetProperty(fade, new PropertyPath(UIElement.OpacityProperty));
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文