Windows phone 8.1 Windows Phone 8.1上的“处理后退”按钮
我的Windows Phone 8.1应用程序中有2个页面Windows phone 8.1 Windows Phone 8.1上的“处理后退”按钮,windows-phone-8.1,Windows Phone 8.1,我的Windows Phone 8.1应用程序中有2个页面 <Button BorderThickness="0" Name="btn4" Grid.Row="2" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" > <Button.Background > <ImageBrush ImageSource="
<Button BorderThickness="0" Name="btn4" Grid.Row="2" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-4-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn5" Grid.Row="2" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-5-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn6" Grid.Row="2" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-6-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn7" Grid.Row="3" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-7-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn8" Grid.Row="3" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-8-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn9" Grid.Row="3" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-9-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btnReset" Grid.Row="4" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" Margin="0" Padding="9.5,0,9.5,3.5" >
<Button.Background >
<ImageBrush ImageSource="ms-appx:///Images/undo.png" Stretch="Uniform" />
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn0" Grid.Row="4" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-0-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btnDel" Grid.Row="4" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/delete_key.png" Stretch="Uniform"/>
</Button.Background>
</Button>
</Grid>
<Grid x:Name="Footer" Background="Black" Grid.Row="4" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Name="txtError" Grid.Column="0" FontSize="18" Margin="10,10,10,10" Text="Enter PIN" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" Foreground="#FFE8E82F" FontWeight="Bold" />
</Grid>
</Grid>
第一页显示9个图像按钮。其目的是允许用户输入其4位PIN以进入下一屏幕
<Button BorderThickness="0" Name="btn4" Grid.Row="2" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-4-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn5" Grid.Row="2" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-5-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn6" Grid.Row="2" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-6-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn7" Grid.Row="3" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-7-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn8" Grid.Row="3" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-8-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn9" Grid.Row="3" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-9-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btnReset" Grid.Row="4" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" Margin="0" Padding="9.5,0,9.5,3.5" >
<Button.Background >
<ImageBrush ImageSource="ms-appx:///Images/undo.png" Stretch="Uniform" />
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn0" Grid.Row="4" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-0-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btnDel" Grid.Row="4" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/delete_key.png" Stretch="Uniform"/>
</Button.Background>
</Button>
</Grid>
<Grid x:Name="Footer" Background="Black" Grid.Row="4" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Name="txtError" Grid.Column="0" FontSize="18" Margin="10,10,10,10" Text="Enter PIN" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" Foreground="#FFE8E82F" FontWeight="Bold" />
</Grid>
</Grid>
情景:
<Button BorderThickness="0" Name="btn4" Grid.Row="2" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-4-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn5" Grid.Row="2" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-5-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn6" Grid.Row="2" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-6-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn7" Grid.Row="3" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-7-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn8" Grid.Row="3" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-8-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn9" Grid.Row="3" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-9-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btnReset" Grid.Row="4" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" Margin="0" Padding="9.5,0,9.5,3.5" >
<Button.Background >
<ImageBrush ImageSource="ms-appx:///Images/undo.png" Stretch="Uniform" />
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn0" Grid.Row="4" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-0-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btnDel" Grid.Row="4" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/delete_key.png" Stretch="Uniform"/>
</Button.Background>
</Button>
</Grid>
<Grid x:Name="Footer" Background="Black" Grid.Row="4" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Name="txtError" Grid.Column="0" FontSize="18" Margin="10,10,10,10" Text="Enter PIN" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" Foreground="#FFE8E82F" FontWeight="Bold" />
</Grid>
</Grid>
用户输入PIN并进入第二屏幕
<Button BorderThickness="0" Name="btn4" Grid.Row="2" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-4-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn5" Grid.Row="2" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-5-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn6" Grid.Row="2" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-6-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn7" Grid.Row="3" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-7-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn8" Grid.Row="3" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-8-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn9" Grid.Row="3" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-9-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btnReset" Grid.Row="4" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" Margin="0" Padding="9.5,0,9.5,3.5" >
<Button.Background >
<ImageBrush ImageSource="ms-appx:///Images/undo.png" Stretch="Uniform" />
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn0" Grid.Row="4" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-0-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btnDel" Grid.Row="4" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/delete_key.png" Stretch="Uniform"/>
</Button.Background>
</Button>
</Grid>
<Grid x:Name="Footer" Background="Black" Grid.Row="4" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Name="txtError" Grid.Column="0" FontSize="18" Margin="10,10,10,10" Text="Enter PIN" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" Foreground="#FFE8E82F" FontWeight="Bold" />
</Grid>
</Grid>
我去睡觉
<Button BorderThickness="0" Name="btn4" Grid.Row="2" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-4-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn5" Grid.Row="2" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-5-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn6" Grid.Row="2" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-6-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn7" Grid.Row="3" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-7-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn8" Grid.Row="3" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-8-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn9" Grid.Row="3" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-9-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btnReset" Grid.Row="4" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" Margin="0" Padding="9.5,0,9.5,3.5" >
<Button.Background >
<ImageBrush ImageSource="ms-appx:///Images/undo.png" Stretch="Uniform" />
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn0" Grid.Row="4" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-0-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btnDel" Grid.Row="4" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/delete_key.png" Stretch="Uniform"/>
</Button.Background>
</Button>
</Grid>
<Grid x:Name="Footer" Background="Black" Grid.Row="4" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Name="txtError" Grid.Column="0" FontSize="18" Margin="10,10,10,10" Text="Enter PIN" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" Foreground="#FFE8E82F" FontWeight="Bold" />
</Grid>
</Grid>
我醒来
<Button BorderThickness="0" Name="btn4" Grid.Row="2" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-4-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn5" Grid.Row="2" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-5-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn6" Grid.Row="2" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-6-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn7" Grid.Row="3" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-7-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn8" Grid.Row="3" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-8-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn9" Grid.Row="3" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-9-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btnReset" Grid.Row="4" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" Margin="0" Padding="9.5,0,9.5,3.5" >
<Button.Background >
<ImageBrush ImageSource="ms-appx:///Images/undo.png" Stretch="Uniform" />
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn0" Grid.Row="4" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-0-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btnDel" Grid.Row="4" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/delete_key.png" Stretch="Uniform"/>
</Button.Background>
</Button>
</Grid>
<Grid x:Name="Footer" Background="Black" Grid.Row="4" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Name="txtError" Grid.Column="0" FontSize="18" Margin="10,10,10,10" Text="Enter PIN" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" Foreground="#FFE8E82F" FontWeight="Bold" />
</Grid>
</Grid>
我去我的手机
<Button BorderThickness="0" Name="btn4" Grid.Row="2" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-4-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn5" Grid.Row="2" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-5-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn6" Grid.Row="2" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-6-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn7" Grid.Row="3" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-7-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn8" Grid.Row="3" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-8-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn9" Grid.Row="3" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-9-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btnReset" Grid.Row="4" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" Margin="0" Padding="9.5,0,9.5,3.5" >
<Button.Background >
<ImageBrush ImageSource="ms-appx:///Images/undo.png" Stretch="Uniform" />
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn0" Grid.Row="4" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-0-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btnDel" Grid.Row="4" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/delete_key.png" Stretch="Uniform"/>
</Button.Background>
</Button>
</Grid>
<Grid x:Name="Footer" Background="Black" Grid.Row="4" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Name="txtError" Grid.Column="0" FontSize="18" Margin="10,10,10,10" Text="Enter PIN" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" Foreground="#FFE8E82F" FontWeight="Bold" />
</Grid>
</Grid>
我在第二屏
<Button BorderThickness="0" Name="btn4" Grid.Row="2" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-4-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn5" Grid.Row="2" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-5-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn6" Grid.Row="2" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-6-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn7" Grid.Row="3" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-7-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn8" Grid.Row="3" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-8-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn9" Grid.Row="3" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-9-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btnReset" Grid.Row="4" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" Margin="0" Padding="9.5,0,9.5,3.5" >
<Button.Background >
<ImageBrush ImageSource="ms-appx:///Images/undo.png" Stretch="Uniform" />
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn0" Grid.Row="4" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-0-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btnDel" Grid.Row="4" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/delete_key.png" Stretch="Uniform"/>
</Button.Background>
</Button>
</Grid>
<Grid x:Name="Footer" Background="Black" Grid.Row="4" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Name="txtError" Grid.Column="0" FontSize="18" Margin="10,10,10,10" Text="Enter PIN" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" Foreground="#FFE8E82F" FontWeight="Bold" />
</Grid>
</Grid>
我按下后退按钮
<Button BorderThickness="0" Name="btn4" Grid.Row="2" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-4-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn5" Grid.Row="2" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-5-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn6" Grid.Row="2" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-6-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn7" Grid.Row="3" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-7-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn8" Grid.Row="3" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-8-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn9" Grid.Row="3" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-9-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btnReset" Grid.Row="4" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" Margin="0" Padding="9.5,0,9.5,3.5" >
<Button.Background >
<ImageBrush ImageSource="ms-appx:///Images/undo.png" Stretch="Uniform" />
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn0" Grid.Row="4" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-0-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btnDel" Grid.Row="4" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/delete_key.png" Stretch="Uniform"/>
</Button.Background>
</Button>
</Grid>
<Grid x:Name="Footer" Background="Black" Grid.Row="4" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Name="txtError" Grid.Column="0" FontSize="18" Margin="10,10,10,10" Text="Enter PIN" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" Foreground="#FFE8E82F" FontWeight="Bold" />
</Grid>
</Grid>
“我的按钮”上的图像不显示
<Button BorderThickness="0" Name="btn4" Grid.Row="2" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-4-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn5" Grid.Row="2" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-5-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn6" Grid.Row="2" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-6-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn7" Grid.Row="3" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-7-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn8" Grid.Row="3" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-8-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn9" Grid.Row="3" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-9-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btnReset" Grid.Row="4" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" Margin="0" Padding="9.5,0,9.5,3.5" >
<Button.Background >
<ImageBrush ImageSource="ms-appx:///Images/undo.png" Stretch="Uniform" />
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn0" Grid.Row="4" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-0-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btnDel" Grid.Row="4" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/delete_key.png" Stretch="Uniform"/>
</Button.Background>
</Button>
</Grid>
<Grid x:Name="Footer" Background="Black" Grid.Row="4" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Name="txtError" Grid.Column="0" FontSize="18" Margin="10,10,10,10" Text="Enter PIN" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" Foreground="#FFE8E82F" FontWeight="Bold" />
</Grid>
</Grid>
我仍然可以按我的“隐形”按钮
<Button BorderThickness="0" Name="btn4" Grid.Row="2" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-4-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn5" Grid.Row="2" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-5-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn6" Grid.Row="2" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-6-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn7" Grid.Row="3" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-7-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn8" Grid.Row="3" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-8-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn9" Grid.Row="3" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-9-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btnReset" Grid.Row="4" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" Margin="0" Padding="9.5,0,9.5,3.5" >
<Button.Background >
<ImageBrush ImageSource="ms-appx:///Images/undo.png" Stretch="Uniform" />
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn0" Grid.Row="4" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-0-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btnDel" Grid.Row="4" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/delete_key.png" Stretch="Uniform"/>
</Button.Background>
</Button>
</Grid>
<Grid x:Name="Footer" Background="Black" Grid.Row="4" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Name="txtError" Grid.Column="0" FontSize="18" Margin="10,10,10,10" Text="Enter PIN" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" Foreground="#FFE8E82F" FontWeight="Bold" />
</Grid>
</Grid>
为什么我的图像不显示
<Button BorderThickness="0" Name="btn4" Grid.Row="2" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-4-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn5" Grid.Row="2" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-5-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn6" Grid.Row="2" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-6-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn7" Grid.Row="3" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-7-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn8" Grid.Row="3" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-8-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn9" Grid.Row="3" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-9-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btnReset" Grid.Row="4" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" Margin="0" Padding="9.5,0,9.5,3.5" >
<Button.Background >
<ImageBrush ImageSource="ms-appx:///Images/undo.png" Stretch="Uniform" />
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn0" Grid.Row="4" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-0-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btnDel" Grid.Row="4" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/delete_key.png" Stretch="Uniform"/>
</Button.Background>
</Button>
</Grid>
<Grid x:Name="Footer" Background="Black" Grid.Row="4" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Name="txtError" Grid.Column="0" FontSize="18" Margin="10,10,10,10" Text="Enter PIN" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" Foreground="#FFE8E82F" FontWeight="Bold" />
</Grid>
</Grid>
我的xaml:
<Button BorderThickness="0" Name="btn4" Grid.Row="2" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-4-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn5" Grid.Row="2" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-5-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn6" Grid.Row="2" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-6-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn7" Grid.Row="3" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-7-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn8" Grid.Row="3" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-8-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn9" Grid.Row="3" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-9-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btnReset" Grid.Row="4" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" Margin="0" Padding="9.5,0,9.5,3.5" >
<Button.Background >
<ImageBrush ImageSource="ms-appx:///Images/undo.png" Stretch="Uniform" />
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn0" Grid.Row="4" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-0-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btnDel" Grid.Row="4" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/delete_key.png" Stretch="Uniform"/>
</Button.Background>
</Button>
</Grid>
<Grid x:Name="Footer" Background="Black" Grid.Row="4" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Name="txtError" Grid.Column="0" FontSize="18" Margin="10,10,10,10" Text="Enter PIN" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" Foreground="#FFE8E82F" FontWeight="Bold" />
</Grid>
</Grid>
<Button BorderThickness="0" Name="btn4" Grid.Row="2" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-4-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn5" Grid.Row="2" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-5-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn6" Grid.Row="2" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-6-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn7" Grid.Row="3" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-7-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn8" Grid.Row="3" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-8-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn9" Grid.Row="3" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-9-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btnReset" Grid.Row="4" Grid.Column="0" Width="75" Height="75" HorizontalAlignment="Center" Margin="0" Padding="9.5,0,9.5,3.5" >
<Button.Background >
<ImageBrush ImageSource="ms-appx:///Images/undo.png" Stretch="Uniform" />
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btn0" Grid.Row="4" Grid.Column="1" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/Number-0-icon.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Button BorderThickness="0" Name="btnDel" Grid.Row="4" Grid.Column="2" Width="75" Height="75" HorizontalAlignment="Center" >
<Button.Background >
<ImageBrush ImageSource="/Images/delete_key.png" Stretch="Uniform"/>
</Button.Background>
</Button>
</Grid>
<Grid x:Name="Footer" Background="Black" Grid.Row="4" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Name="txtError" Grid.Column="0" FontSize="18" Margin="10,10,10,10" Text="Enter PIN" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" Foreground="#FFE8E82F" FontWeight="Bold" />
</Grid>
</Grid>
你能显示代码吗?特别是那些带有图像的按钮,你如何加载图像?您的应用程序有可能被终止,然后被恢复。@Romasz您好,我将发布xaml。。