如何在 Silverlight 4 中的选项卡控件内显示 XAML
我想知道如何在作为另一个 XAML 页面一部分的选项卡控件中显示 XAML 页面。或者,就此而言,如果这可能的话。我希望能够单击 page1 上的按钮,并能够从 page1 上的选项卡控件中查看 page2。
这是否需要在框架控件中处理?或者有什么不同?或者有更好的方法吗?
我正在 Visual Studio 2010 中使用 Silverlight-4.0、C#-4.0 进行编程。
I am wondering how to display a XAML page within a tab control that is part of another XAML page. Or, for that matter, if this is even possible. I want to be able to click a button on page1 and be able to view the page2 from within a tab control that is on page1.
Would this be something to be handled within a Frame control? Or something different? Or is there a better approach to this altogether?
I am programming in Silverlight-4.0, C#-4.0 from within Visual Studio 2010.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用导航框架,但这并不是您真正想要的。您想知道如何将一个文件的内容放入一个选项卡中,而另一个文件的内容放在另一个选项卡中。
silverlight 中的页面只是一个用户控件。您可以将用户控件放入选项卡中,就像放置任何其他控件一样。为了在另一个 xaml 文件中使用本地用户控件,您需要执行以下操作:
将其添加到包含选项卡的页面的根元素:
然后您可以添加此控件以将控件添加到选项卡中:
You could use the navigation framework, but that isn't really what you're asking. You want to know how to put the contents of one file into a tab, while the contents of another file are in the other tab.
A page in silverlight is simply a user control. You can put a usercontrol into the tab just like you would any other control. In order to use a local usercontrol in another xaml file, you'll need to do the following:
Add this to the root element of the page containing the tabs:
Then you can add this to add the control into the tab:
您可以检查 Silverlight Navgition Framework 您可以显示“框架”在您的控制范围内。它还支持深度链接,这是这里的杀手级功能。
这个是一个非常好的介绍 - Tim Heuer
You can check the Silverlight Navgition Framework You can show "frames" inside your control. It also support deep linking, which is the killer feature here..
This is a very good intro - by Tim Heuer