在 Windows 10 中,通用应用程序在桌面环境下是支持从资源管理器拖放文件打开的。这篇博文将演示拖放图片或文本文件,并在程序中打开显示。前台 XAML:<Page x:Class="DropDemo.MainPage" ="http: ...
在 Windows 10 中,通用应用程序在桌面环境下是支持从资源管理器拖放文件打开的。
这篇博文将演示拖放图片或文本文件,并在程序中打开显示。
前台 XAML:
<Page x:Class="DropDemo.MainPage" ="http://schemas.microsoft.com/get='_blank'>winfx/2006/xaml/presentation" ="http://schemas.microsoft.com/winfx/2006/xaml" ="using:DropDemo" ="http://schemas.microsoft.com/expression/blend/2008" ="http://schemas.open mc:Ignorable="d"> <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" AllowDrop="True" DragOver="Grid_DragOver" Drop="Grid_Drop"> <Image x:Name="img" Visibility="Collapsed" /> <TextBlock x:Name="txt" Visibility="Collapsed" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="30" /> </Grid></Page>
原标题:【Win10】文件拖放打开
关键词:win
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。