在UWP APP中,禁用TittleBar中的关闭按钮 [英] In UWP APP, Disabling Close button in TittleBar

查看:134
本文介绍了在UWP APP中,禁用TittleBar中的关闭按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经搜索了很多内容,



有没有办法禁用tittle bar中的关闭按钮UWP app。


我知道更改标题栏的颜色和所有,即使在该功能可用之后


 

解决方案

嗨RamyaBlr,


目前,UWP应用可以改变Tittlebar的颜色及其上的按钮但是它不可能禁用这些按钮。这是设计使然。 


但是您可以在Windows 10 Creators更新(15063)之后处理关闭请求,您可以处理

SystemNavigationManagerPreview.CloseRequested事件
以更改关闭行为。如果您想使用此功能,请记得在清单文件中添加confirmAppClose功能。

< rescap:Capability Name =" confirmAppClose" ; /> 

您可以查看此官方示例,了解如何使用此API:https://github.com/Microsoft/DesktopBridgeToUWP-Samples/blob/master/Samples/UWP%20Systray/SystrayExtension/MainPage.xaml。 cs#L33



祝你好运,


Roy


I already googled a lot to find out,

Is there any way to disable the close button in tittle bar in UWP app.

I am aware of changing the color of title bar and all, Even after that functionality will work 

 

解决方案

Hi RamyaBlr,

Currently, UWP app could change the color for the Tittlebar and the buttons on it but it is not possbile to disabling the these buttons. This is by design. 

But you could handle the close request after Windows 10 Creators Update(15063), You could handle SystemNavigationManagerPreview.CloseRequested Event to change the close behavior. If you want to use this function, please remember to add the confirmAppClose capability in the manifest file.

<rescap:Capability Name="confirmAppClose" />

You could check this official sample about how to use this API:https://github.com/Microsoft/DesktopBridgeToUWP-Samples/blob/master/Samples/UWP%20Systray/SystrayExtension/MainPage.xaml.cs#L33

Best regards,

Roy


这篇关于在UWP APP中,禁用TittleBar中的关闭按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆