使用 Silverlight.FX Window for MVVM 作为 Silverlight 3.0 页面?

发布于 2024-08-09 09:12:49 字数 283 浏览 5 评论 0原文

我正在使用 Silverlight.FX 创建 Silverlight 3.0 MVVM 应用程序,但我的视图实际上使用的是 Silverlight 导航系统,即页面。按照 Nikhil 的示例,我的视图应该源自 Silverlight。 FX 窗口类。

制作一个也支持页面功能的窗口的最佳方法是什么,或者是否已经有这样做的东西?

I'm creating a Silverlight 3.0 MVVM application using Silverlight.FX but my View is actually using the Silverlight navigation system, a Page. Following Nikhil's example, my View should derive from the Silverlight.FX Window class.

What's the best approach to making a Window that also supports the Page functionality or is there something that already does this?

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

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

发布评论

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

评论(2

独木成林 2024-08-16 09:12:49

发现了 Silverlight.FX 的 Page 和 PageFrame 类。这些类具有与 Silverlight 导航类型相同的基本功能,但支持我正在寻找的绑定。

xmlns:fxnav="clr-namespace:SilverlightFX.UserInterface.Navigation;assembly=SilverlightFX"
...
<fxnav:PageFrame x:Name="_frame"
                 IsIntegratedWithBrowser="True"
                 DefaultUri="StartView"
                 HorizontalContentAlignment="Stretch"/>

我无法从页面的代码隐藏中获取父容器(与 Silverlight 3.0 页面不同),但一旦删除 Click 处理程序并完全切换到 MVVM,我就不需要它了。

Discovered the Page and PageFrame classes of Silverlight.FX. These classes have the same basic functionality as the Silverlight navigation types but with support for the binding I was looking for.

xmlns:fxnav="clr-namespace:SilverlightFX.UserInterface.Navigation;assembly=SilverlightFX"
...
<fxnav:PageFrame x:Name="_frame"
                 IsIntegratedWithBrowser="True"
                 DefaultUri="StartView"
                 HorizontalContentAlignment="Stretch"/>

I'm having trouble grabbing the parent container from the Pages' code-behind (unlike the Silverlight 3.0 Page) but I shouldn't need it once I remove the Click handler and fully switch to MVVM anyway.

值得一提的是,PageFrame 的默认 PageLoader 组件会自动映射所有可用页面。无法将 Silverlight 3 中的新 UriMapping 组件与 SilverlightFX 的 PageFrame 一起使用。因此,如果您的页面被命名为 MySilverlightPage.xaml(并且相应的页面类具有相同的名称),则它将在“mysilverlight”地址中可用。

PS我决定提及它,因为当我第一次尝试使用SilverlightFX时我并不清楚。

It is worth to mention that PageFrame's default PageLoader component automatically mapping all pages available. There is no way to use new UriMapping component from Silverlight 3 with SilverlightFX's PageFrame. So, if your page is named as MySilverlightPage.xaml (and corresponding page class has the same name), it will be available at "mysilverlight" address.

P.S. I decided to mention it, because it was not clear for me when I tried to use SilverlightFX first time.

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