作者:.NET开发
项目:System.Windows.Intero
private void Button_Click(object sender, RoutedEventArgs e)
{
// Retrieve the script object. The XBAP must be hosted in a frame or
// the HostScript object will be null.
var scriptObject = BrowserInteropHelper.HostScript;
// Call close to close the browser window.
scriptObject.Close();
}