ICode9

精准搜索请尝试: 精确搜索
首页 > 编程语言> 文章详细

c# – 插件在Win 7上的应用程序刷新页面崩溃

2019-06-30 15:05:45  阅读:267  来源: 互联网

标签:c windows-7 silverlight-4-0 silverlight-oob silverlight-plugin


我有一个Silverlight 4 oob应用程序的页面.安装应用程序后,页面上的bage应自动刷新.
我尝试从InstallStateChanged上的代码调用脚本或简单的Document.Submit – 它们在win XP上都运行良好(不仅在我的机器上),但在Win 7或Vista上,页面挂起甚至Silverlight插件在安装开始之前崩溃.但是没有刷新功能,安装过程顺利进行.
我该如何为这些系统进行正确的刷新?为什么会发生这种情况的信息也会有所帮助.

    public App ()
    {
        this.Startup += this.Application_Startup;
        this.Exit += this.Application_Exit;
        this.UnhandledException += this.Application_UnhandledException;

        InitializeComponent();

        App.Current.InstallStateChanged += (s, c) => HtmlPage.Document.Submit(); //used that as the most common used example
    }

    private void Application_Startup (object sender, StartupEventArgs e)
    {
        if (Application.Current.IsRunningOutOfBrowser)
        {
            this.RootVisual = new MainPage();
        } else if (Application.Current.InstallState == InstallState.Installed)
        {
            this.RootVisual = new InstalledPage();
        } else
        {
            this.RootVisual = new InstallPage();
        }
    }

其中MainPage和installedPage是带有文本字段的简单网格.安装页面仅包含点击事件的按钮 – 安装应用程序.网页是自动生成的.而已.仍然在Win 7和Vista上有相同的概率,因为他们有安装.

UPD:project files

解决方法:

我已经改变了你的测试用例:

public App () {
        ...

    App.Current.InstallStateChanged += new EventHandler(Current_InstallStateChanged);
}

void Current_InstallStateChanged(object sender, EventArgs e) {
    if(App.Current.InstallState == System.Windows.InstallState.Installed) {
        HtmlPage.Document.Submit();
    }
}

并且它在Windows 7上安装时刷新.

标签:c,windows-7,silverlight-4-0,silverlight-oob,silverlight-plugin
来源: https://codeday.me/bug/20190630/1337806.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有