如何检测用户是否在Silverlight App中关闭浏览器 [英] How to detect if user close Browser within Silverlight App

查看:64
本文介绍了如何检测用户是否在Silverlight App中关闭浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检测用户是否在Silverlight应用程序中关闭了浏览器?

How to detect if user close Browser within Silverlight App?

我们可以以某种方式抓取它,以便以后保存在数据库中吗?

Can we grab it somehow so later save in database?

有任何线索吗?

推荐答案

在App.xaml.cs类中,您可以预订Exit事件。

In your App.xaml.cs class, you can subscribe to the Exit event.

public partial class App : Application
{    
    public App()
    {
        this.Exit += this.Application_Exit;

        InitializeComponent();
    }

    private void Application_Exit(object sender, EventArgs e)
    {
        Debug.WriteLine("Application Exiting");
    }
}

这篇关于如何检测用户是否在Silverlight App中关闭浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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