我正在尝试在我的第一个应用中放置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。但是,如果我向后滑动到PivotEntry
,PivotList
的BottomAppBar会停留。我预计PivotEntry
的BottomAppBar会重新出现!
怎么了?拜托,帮助我!