Windows phone 7 数据透视项wp7中的数据模板
我想在wp7中创建一个数据透视页:Windows phone 7 数据透视项wp7中的数据模板,windows-phone-7,xaml,windows-phone-7.1,Windows Phone 7,Xaml,Windows Phone 7.1,我想在wp7中创建一个数据透视页: <Grid x:Name="LayoutRoot" Background="Transparent"> <!--Pivot Control--> <controls:Pivot Title="MY APPLICATION"> <!--Pivot item one--> <controls:PivotItem Header="item1">
<Grid x:Name="LayoutRoot" Background="Transparent">
<!--Pivot Control-->
<controls:Pivot Title="MY APPLICATION">
<!--Pivot item one-->
<controls:PivotItem Header="item1">
<Grid/>
</controls:PivotItem>
<!--Pivot item two-->
<controls:PivotItem Header="item2">
<Grid/>
</controls:PivotItem>
</controls:Pivot>
</Grid>
如何使用Datatemplate将每个数据透视项与每篇文章绑定(我需要在数据透视项的标题中显示每篇文章的标题,并在webbrowser中显示说明,因为它是HTML)
致以最诚挚的问候首先,要为每篇文章创建
数据透视项
,只需使用ItemsSource
属性:
<controls:Pivot Title="MY APPLICATION" ItemsSource="{Binding Path=TheListOfArticles}">
同样,覆盖ItemTemplate
以定义每个数据透视项的显示方式:
<controls:Pivot.ItemTemplate>
<DataTemplate>
<!-- whatever -->
</DataTemplate>
</controls:Pivot.ItemTemplate>
<controls:Pivot ItemsSource="{Binding Path=TheListOfArticles}" Title="MY APPLICATION">
<controls:Pivot.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Title}" />
</DataTemplate>
</controls:Pivot.HeaderTemplate>
</controls:Pivot>
<controls:Pivot.ItemTemplate>
<DataTemplate>
<!-- whatever -->
</DataTemplate>
</controls:Pivot.ItemTemplate>