Silverlight 浏览器外应用程序中的新窗口

发布于 2024-11-16 03:49:52 字数 384 浏览 5 评论 0原文

在不在浏览器中运行的 Silverlight 应用程序中,是否可以创建新的顶级窗口?或者至少有一个子窗口?

我使用 < 找到了一些解决方案code>ChildWindow 类,但即使我的项目配置为 Silverlight 4,也找不到该类。

我有一个 UserControl (XAML 文件),我想将其显示为新窗口。不幸的是,使用选项卡控件并不是真正的一种选择,因为用户必须能够排列窗口才能同时看到多个窗口。

有什么建议吗?

In a Silverlight application that doesn't run in a browser, is it possible to create a new top-level window? Or at least a child window?

I found some solution using the ChildWindow class, but even though my project is configured for Silverlight 4, that class can not be found.

I have a UserControl (XAML file) that I want to show as a new window. Using a tab control is not really an option unfortunately as the user has to be able to arrange windows to see more than one at once.

Any suggestions?

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

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

发布评论

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

评论(1

ChildWindow 是 SDK 的一部分,您需要添加 System.Windows.Controls.dll 来访问 ChildWindow 类型。

我不确定您能否让 ChildWindow 执行您所期望的操作。 ChildWindow 被设计为以模态方式呈现窗口。然而,这种模式行为实际上是 ChildWindow 模板的一个功能。可以重新模板以删除模态行为。但是我从未尝试过操纵多个子窗口。您可以尝试一下,最大的问题是,如果您以与创建子窗口不同的顺序关闭子窗口,会发生什么?

为了使用 ChildWindow 来呈现您的 UserControl,您最好从 ChildWindow 派生,而不是 UserControl< /代码>。您甚至可能会发现,最终最好在特定的 Xaml 和 ChildWindow 之间创建基类,在其中放置所有窗口通用的代码。

我可能值得注意的是 Silverlight 5 将支持多个窗口。

ChildWindow is part of the SDK, you need to add the System.Windows.Controls.dll to access the ChildWindow type.

I'm not sure you can get the ChildWindow to do what you are expecting. A ChildWindow is designed to present a window in a modal manner. However this modal behaviour is really a function of the ChildWindow template. It is possible to re-template to remove the modal behaviour. However I've never tried to manipulate multiple child windows. You could give it a go, the big question would be what happens if you close Child windows in a different order in which they were created?

In order to use a ChildWindow to present your UserControl it would probably be best for you to derive from ChildWindow, instead of UserControl. You may even find it would ultimately be better for you create base class between your specific Xaml and ChildWindow where you would put code that is common to all your windows.

I might be worth you noting the Silverlight 5 will support multiple windows.

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