[英]How to insert windows phone page to pivot item?
I have a problem with Pivot
control. 我对
Pivot
控件有问题。 How can I insert xaml page with content to Pivot
item? 如何将带有内容的xaml页面插入到
Pivot
项目? Is it even possible? 可能吗?
When I'm storing everything in one file it's really hard to take control over my own application layout. 当我将所有内容存储在一个文件中时,很难控制自己的应用程序布局。
I want something like this: 我想要这样的东西:
Add correct namespace to Page: 向页面添加正确的名称空间:
xmlns:view="clr-namespace:YourApp.Controls"
and in Pivot: 并在Pivot中:
<Pivot>
<PivotItem Name="first">
<view:FirstUserControl DataContext="{Binding YourViewModel}"/>
</PivotItem>
</Pivot>
And in view namespace you need to create a User Control . 并且在视图名称空间中,您需要创建一个用户控件 。 The link is about WPF but in WP7 there is the same system.
该链接与WPF有关,但是在WP7中有相同的系统。
Also, you can create Custom Control from PivotItem. 此外,您可以从PivotItem创建自定义控件 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.