启用silverlight3的out of browser

本文介绍如何通过修改AppManifest.xml文件实现WPF应用程序的Out of Browser部署,包括判断程序是否处于离线运行状态及调整窗口大小的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

启用out of browser需要修改项目中Properties文件夹下的AppManifest.xml文件
<Deployment 
  
xmlns="http://schemas.microsoft.com/client/2007/deployment"
  xmlns:x
="http://schemas.microsoft.com/winfx/2006/xaml">
  
<Deployment.Parts>
  
</Deployment.Parts>
  
<Deployment.ApplicationIdentity>
    
<ApplicationIdentity
        
ShortName="Out of Browser"
        Title
="This app is out of the browser!">
      
<ApplicationIdentity.Blurb>
        Sample Out of the Browser App
      
</ApplicationIdentity.Blurb>
    
</ApplicationIdentity>
  
</Deployment.ApplicationIdentity>
</Deployment>
在写了一下out of browser的判断
public MainControl()
{
// Required to initialize variables
InitializeComponent();
            App.Current.Host.Content.Resized 
+= new EventHandler(Content_Resized);
            
this.Loaded += new RoutedEventHandler(MainControl_Loaded);
}

        
void MainControl_Loaded(object sender, RoutedEventArgs e)
        {
            
if (App.Current.RunningOffline) {
                xTxt.Text 
= "out of browser";
            }
        }

        
void Content_Resized(object sender, EventArgs e)
        {
            
this.Width = App.Current.Host.Content.ActualWidth;
            
this.Height = App.Current.Host.Content.ActualHeight;
        }
运行程序的界面
右键点击
选择安装out of browser
运行效果
卸载也很方便 不管是在浏览器 还是 在 out of browser中点击右键都会出现卸载选项。

转载于:https://www.cnblogs.com/silverLee/archive/2009/11/07/1598036.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值