我正在研究Windows Phone 8 app
并在 XAML 中有一个像这样的图像视图:
<Image Name="Image"
Grid.Row="0"
Visibility="Collapsed"
Width="Auto"
Height="Auto"
Tap="Image_tap"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Margin="1,1,1,1"/>
现在我把这个事件称为Tap="Image_tap"
,当我点击图像时,我想全屏显示相同的图像,顶部和底部没有任何栏,如何实现这一点?
另一种方法是显示弹出窗口,无需在页面之间传递图像详细信息:
private void HandleTapImage(object sender, GestureEventArgs e)
{
var myPopup = new Popup
{
Child = new Image
{
Source = ((Image) sender).Source,
Stretch = Stretch.UniformToFill,
Height = Application.Current.Host.Content.ActualHeight,
Width = Application.Current.Host.Content.ActualWidth
}
};
myPopup.IsOpen = true;
}
(选择最适合您需求的 Strech 值)。
然而,使用这种方法,您必须手动隐藏 ApplicationBar 和 SystemTray(如果存在)HandleTapImage
方法。您还必须隐藏弹出窗口并再次显示栏。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)