个人资料

跳过导航链接首页 > 博客列表 > 博客正文

UWP将应用最小化和最大化

:
最小化:
IList<AppDiagnosticInfo> infos = await AppDiagnosticInfo.RequestInfoForAppAsync();
IList<AppResourceGroupInfo> resourceInfos = infos[0].GetResourceGroups();
await resourceInfos[0].StartSuspendAsync();
对于1809以下SDK版本,即使最小化自己的app也需要declare the 'appDiagnostics' capability in your manifest

ms-settings:privacy-appdiagnostics

1809及以上版本不需要,但如果最小化其他app仍需要此功能声明.

参考:https://stackoverflow.com/questions/50020408/minimize-uwp-programatically


====

最大化:


			var view = ApplicationView.GetForCurrentView();
			if (mediaElement.IsFullWindow)
			{
				view.TryEnterFullScreenMode();
			}
			else
			{
				view.ExitFullScreenMode();
			}


songshizhao
最初发表2019/10/29 0:53:16 最近更新2019/12/6 19:55:15 2400
为此篇作品打分
10