在Pivot中使用2个不同的Page.BottomAppBar

时间:2015-01-28 20:58:19

标签: c# windows xaml windows-phone-8.1

我正在尝试在我的第一个应用中放置2个Page.BottomAppBars。但是,它不能正常工作。

MainPage.xaml中:

    <Grid>
    <Pivot Name="Pivot" Title="Timecard" SelectionChanged="Pivot_SelectionChanged">
        <PivotItem Header="entry">
            <local:PivotEntry />
        </PivotItem>
        <PivotItem Header="list">
            <local:PivotList />
        </PivotItem>
    </Pivot>
</Grid>

PivotEntry.xaml

    <Page.BottomAppBar>
    <CommandBar Name="AppBar" Visibility="Visible">
        <CommandBar.PrimaryCommands>
            <AppBarButton Name="SaveEntryButton" Click="Save_Click" Icon="Save" IsCompact="False" Label="save" />
        </CommandBar.PrimaryCommands>
        <CommandBar.SecondaryCommands>
            <AppBarButton Name="SaveEntryText" Label="save" Click="Save_Click" />
        </CommandBar.SecondaryCommands>
    </CommandBar>
</Page.BottomAppBar>

PivotList.xaml

    <Page.BottomAppBar>
    <CommandBar Name="AppBar" Visibility="Visible">
        <CommandBar.PrimaryCommands>
            <AppBarButton Name="RefreshEntriesButton" Click="Refresh_Click" Icon="Refresh" IsCompact="False" Label="refresh" />
            <AppBarButton Name="ClearEntriesButton" Click="Clear_Click" Icon="Clear" IsCompact="False" Label="clear" />
        </CommandBar.PrimaryCommands>
        <CommandBar.SecondaryCommands>
            <AppBarButton Name="RefreshEntriesText" Label="refresh" Click="Refresh_Click"/>
            <AppBarButton Name="ClearEntriesText" Label="clear" Click="Clear_Click"/>
        </CommandBar.SecondaryCommands>
    </CommandBar>
</Page.BottomAppBar>

当我在页面之间滑动时,PivotList的BottomAppBar会覆盖PivotEntry的BottomAppBar。但是,如果我向后滑动到PivotEntryPivotList的BottomAppBar会停留。我预计PivotEntry的BottomAppBar会重新出现!

怎么了?拜托,帮助我!

0 个答案:

没有答案