gpt4 book ai didi

c# - 如何关闭 silverlight 中的应用程序

转载 作者:太空宇宙 更新时间:2023-11-03 13:19:40 24 4
gpt4 key购买 nike

我是 Silverlight 初学者,在这种情况下,我必须创建登录弹出窗口,让用户在输入“确定”按钮后可以继续,但我希望在单击“取消”按钮时关闭应用程序。

实际上这个登录弹窗是一个ChildWindow

我已经尝试了 Application.Current.MainWindow.Close();Application.Current.Exit; 它们都不起作用。 有人可以帮助我实现我的目标吗。

最佳答案

您需要将您的应用程序配置为在浏览器外部运行时需要更高的信任度。

参见此处:http://msdn.microsoft.com/en-us/library/dd833073(v=vs.95).aspx

To configure out-of-browser support In Solution Explorer, select the Silverlight project for which you want to enable out-of-browser support. On the Project menu, select project name Properties. On the Silverlight tab, select Enable running application out of the browser. Click Out-of-Browser Settings. The Out-of-Browser Settings dialog box appears. Specify values for the indicated fields and then click OK. All fields are optional except for the following: Window, Title, Shortcut name, Application description

将 SecuritySettings.ElevatedPermissions 属性设置为 Required。

http://msdn.microsoft.com/en-us/library/system.windows.securitysettings.elevatedpermissions(v=vs.95).aspx

关于c# - 如何关闭 silverlight 中的应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24805078/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com