在UWP XAML中强制显示效果

时间:2018-06-07 21:52:48

标签: xaml uwp windows-10-universal

我为我的UWP应用定义了一个工具栏,如下所示:

<StackPanel Orientation="Horizontal">
                <ToggleButton Margin="5,5,0,5" Height="40" Width="30" Style="{StaticResource ToggleButtonRevealStyle}" Background="Transparent" BorderThickness="1,1,0,1" FontFamily="Segoe MDL2 Assets " Content="&#xF156;"/>
                <ToggleButton Margin="0,5,5,5" Height="40" Width="30" Style="{StaticResource ToggleButtonRevealStyle}" Background="Transparent" BorderThickness="0,1,1,1" FontFamily="Segoe MDL2 Assets " Content="&#xE8FD;"/>

                <Button Margin="5,5,0,5" Height="40" Width="30" Style="{StaticResource ButtonRevealStyle}" Background="Transparent" BorderThickness="1,1,0,1" FontFamily="Segoe MDL2 Assets " Content="&#xE70D;"/>
                <Button Margin="0,5,5,5" Height="40" Width="30" Style="{StaticResource ButtonRevealStyle}" Background="Transparent" BorderThickness="0,1,1,1" FontFamily="Segoe MDL2 Assets " Content="&#xE70E;"/>
                <TextBox Margin="5" TextAlignment="Center" Height="40" Width="1" BorderThickness="1" Background="Transparent" Padding="7" FontSize="16"/>
                <Button Margin="5,5,0,5" Height="40" Width="30" Style="{StaticResource ButtonRevealStyle}" Background="Transparent" BorderThickness="1,1,0,1" FontFamily="Segoe MDL2 Assets " Content="&#xE8A3;"/>
                <Button Margin="0,5,5,5" Height="40" Width="30" Style="{StaticResource ButtonRevealStyle}" Background="Transparent" BorderThickness="0,1,1,1" FontFamily="Segoe MDL2 Assets " Content="&#xE71F;"/>

                <Button Margin="5" Height="40" Width="40" Style="{StaticResource ButtonRevealStyle}" Background="Transparent" BorderThickness="1" FontFamily="Segoe MDL2 Assets " Content="&#xE7AD;"/>
                <Button Margin="5" Height="40" Width="40" Style="{StaticResource ButtonRevealStyle}" Background="Transparent" BorderThickness="1" FontFamily="Segoe MDL2 Assets " Content="&#xE799;"/>
 </StackPanel>

这是(正确的)结果:

enter image description here

但有时候露出效果并没有显示出来:

enter image description here

为什么会这样?如何在任何时候强制执行揭示效果?

0 个答案:

没有答案