首页 技术 正文
技术 2022年11月21日
0 收藏 946 点赞 3,463 浏览 2581 个字

1、调用系统内置滤镜:

Windows.ApplicationModel.CameraApplicationManager.ShowInstalledApplicationsUI();

2、完全退出应用程序:

Application.Current. Exit();

3、通过Url启动系统内容应用:

Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings-lock:"));  //跳转到”锁屏设置“页面Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings-airplanemode:"));  //跳转到”飞行设置“页面Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings-bluetooth:"));  //跳转到”蓝牙设置“页面Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings-cellular:"));  //跳转到”网络设置“页面Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings-wifi:"));   //跳转到”Wifi设置“页面Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings-location:"));  //跳转到”地点设置“页面Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings-emailandaccounts:")); //跳转到”电子邮件+账户设置“页面Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings-screenrotation:"));   //屏幕旋转Windows.System.Launcher.LaunchUriAsync(new Uri("callto:1391234567"));   //拨打指定的电话号码
Windows.System.Launcher.LaunchUriAsync(new Uri("http://webabcd.cnblogs.com/"));  //打开指定的网络地址
Windows.System.Launcher.LaunchUriAsync(new Uri("mailto:aaa@xxx.com"));   //给指定的邮箱发送邮件

4、自定义延迟等待操作:

  Task.Factory.StartNew(async () =>
{
Task.Delay().Wait(); //延迟等待时间间隔
await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
//此处添加需要进行的操作函数
});
});

5、文件读取:

Windows.Storage.KnownFolders;//包含应用常见位置的访问
Windows.ApplicationModel.Package.Current.InstalledLocation; //获取安装包的位置
Windows.Storage.ApplicationData.Current.LocalCacheFolder; //获取本地缓存文件夹
Windows.Storage.ApplicationData.Current.RoamingFolder; //获取漫游数据文件夹
Windows.Storage.ApplicationData.Current.LocalFolder; //获取本地应用文件夹
Windows.Storage.ApplicationData.Current.TemporaryFolder; //获取应用程序临时文件夹

6、隐藏和显示状态栏:

Windows.UI.ViewManagement.StatusBar.GetForCurrentView().HideAsync();
Windows.UI.ViewManagement.StatusBar.GetForCurrentView().ShowAsync();

7、隐藏命令栏:

commandBar.Visibility = Windows.UI.Xaml.Visibility.Collapsed;

8、安装包文件的URI方案:

"ms-appdata:///local/……"    //访问存储在本地文件夹中的文件
"ms-appdata:///roaming/……" //访问存储在漫游文件夹中的文件
"ms-appdata:///temp/……" //访问存储在临时文件夹中的文件
“ms-appdata:///……” //访问安装包文件夹中的文件

9、重写后退键对应的事件:

Windows.Phone.UI.Input.HardwareButtons.BackPressed += HardwareButtons_BackPressed;
void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
{
            //此处添加对应的事件处理
}注:当然你也可以使用委托的方法来进行事件编写,这样更精炼:
Windows.Phone.UI.Input.HardwareButtons.BackPressed += (a,b)=>{ ////此处添加对应的事件处理 };

10、联系人相关操作:

Windows.Phone.PersonalInformation.ContactStore.CreateOrOpenAsync();  //创建联系人ContactInformation info = new ContactInformation();
var porperties = info.GetPropertiesAsync(); //获取联系人

^^^^^^^当然还有很多,到时候想到再依次补充!!!!

以上是我为初学者罗列的一些常用的常用操作,希望对初学者有一些指导。当然,也很欢迎转载,但请注明出处!

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,022
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,513
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,359
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,142
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,773
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,851