简体   繁体   中英

ContentDialog's buttons are not shown in a Windows Phone 8.1 app if the BottomAppBar is defined

I would like to show a ContentDialog on first launch of my app, to show the EULA to the end user. It seems that if an AppBar is defined in the calling page the two buttons in the dialog are not visible, an empty area with the same size of the command bar area defined in the calling page, is shown instead. This is the markup on the ContentDialog:

<ContentDialog
x:Class="MyApp.EulaPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:MyApp.Pages"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Title="TERMS OF USE"
PrimaryButtonText="i agree"  
SecondaryButtonText="cancel"
PrimaryButtonClick="OnAgreeButtonClick"
SecondaryButtonClick="OnCancelButtonClick">

<Grid x:Name="ContentPanel" Margin="0,0,0,0" >
    <Grid.RowDefinitions>
        <RowDefinition  Height="524" />
    </Grid.RowDefinitions>
    <ScrollViewer Grid.Row="0" Margin="0,0,0,2"  >
        <RichTextBlock IsTextSelectionEnabled="False" TextAlignment="Left" TextIndent="0"  FontSize="14" FontFamily="Segoe WP" >
        </RichTextBlock>
    </ScrollViewer>
</Grid>

The GridRowDefinition has a fixed hight, because the text in the RichTextBlock needs to be scrolled.

I have prepared a sample project that can be found here . The zip file contains also a screenshot showing how I see the dialog.

我遇到了同样的问题,并且通过修改/删除了Contentdialog的Height / Width和Margins来解决了这个问题

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM