0

如何向 PivotItem 添加多个项目/控件?


  <!--Pivot Control-->
    <phone:Pivot x:Name="PivotLanguageMain" Margin="0,116,0,0" Foreground="White" Background="{x:Null}">
        <!--Pivot item one-->
        <phone:PivotItem x:Name="PivotItemGurbani" Margin="0,-6,0,0"  >
            <phone:PivotItem.Header>
                <TextBlock Text=" gurmuKI"  FontFamily="/Assets/Fonts/GURAKHAR.TTF#GurbaniAkhar" />
            </phone:PivotItem.Header>
            <ListBox  Margin="0,25,0,72"  x:Name="ListBoxPunjabi" FontSize="48" HorizontalAlignment="Center" SelectionChanged="ListBoxPunjabi_SelectionChanged">

            </ListBox>
        </phone:PivotItem>


        <!--Pivot item two-->
        <phone:PivotItem  x:Name="PivotItemEnglish"  Margin="0,-6,0,0"  >

            <phone:PivotItem.Header>
                <TextBlock Text=" english" FontFamily="/Assets/Fonts/AGENCYR.TTF#Agency FB" />
            </phone:PivotItem.Header>


            <ListBox Margin="0,25,0,48"  x:Name="ListBoxEnglish" HorizontalAlignment="Center" SelectionChanged="ListBoxEnglish_SelectionChanged">

            </ListBox>
            <Popup x:Name="LoadingPopup">
                <TextBlock x:Name="LoadingText" Text="Loading PDF File.." Foreground="#FFBB0000" FontFamily="/Assets/Fonts/AGENCYR.TTF#Agency FB" FontSize="50" FontWeight="Bold" Margin="102,164,93,360"/>
            </Popup>
        </phone:PivotItem>

    </phone:Pivot>

第二个 PivotItem 给我错误: 属性“内容”只能设置一次

4

1 回答 1

1

在 Grid 上添加您的控件。

    <phone:PivotItem x:Name="PivotItemGurbani" Margin="0,-6,0,0"  >
        <phone:PivotItem.Header>
            <TextBlock Text=" gurmuKI"  FontFamily="/Assets/Fonts/GURAKHAR.TTF#GurbaniAkhar" />
        </phone:PivotItem.Header>
        <ListBox  Margin="0,25,0,72"  x:Name="ListBoxPunjabi" FontSize="48" HorizontalAlignment="Center" SelectionChanged="ListBoxPunjabi_SelectionChanged">

        </ListBox>
    </phone:PivotItem>



    <phone:PivotItem  x:Name="PivotItemEnglish"  Margin="0,-6,0,0"  >

        <phone:PivotItem.Header>
            <TextBlock Text=" english" FontFamily="/Assets/Fonts/AGENCYR.TTF#Agency FB" />
        </phone:PivotItem.Header>
        <Grid>
        <ListBox Margin="0,25,0,48"  x:Name="ListBoxEnglish" HorizontalAlignment="Center" SelectionChanged="ListBoxEnglish_SelectionChanged">
        </ListBox>
        <Popup x:Name="LoadingPopup">
            <TextBlock x:Name="LoadingText" Text="Loading PDF File.." Foreground="#FFBB0000" FontFamily="/Assets/Fonts/AGENCYR.TTF#Agency FB" FontSize="50" FontWeight="Bold" Margin="102,164,93,360"/>
        </Popup>
        </Grid>
    </phone:PivotItem>

</phone:Pivot>
于 2014-09-11T05:48:53.900 回答