Win 7 上的应用程序刷新页面时插件崩溃

发布于 2024-11-28 09:18:22 字数 1266 浏览 1 评论 0原文

我有一个包含 Silverlight 4 oob 应用程序的页面。安装应用程序后,页面上的包应该自动刷新。 我尝试从 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:项目文件

I have a page with Silverlight 4 oob app. After app is installed the bage on the page should automatically refresh.
I tried calling the scripts or simple Document.Submit from code on InstallStateChanged - and they all worked well on win XP (not only on my machine), but on Win 7 or Vista the page hangs or even silverlight plugin crashes before the installation beginning. However without refresh function on the installation process flows smoothly.
How should I do the correct refresh for those systems? The info why this can happen will be helpful too.

    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();
        }
    }

Where MainPage and installedPage are simple grids with text field. Install Page contains only button with click event - to install the App. The web page is auto generated one. Nothing more. Still on Win 7 and Vista have the same prob while install as they had.

UPD: project files

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

后eg是否自 2024-12-05 09:18:22

我已经像这样更改了您的测试用例:

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 上安装后刷新良好。

I have changed your test case like this:

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();
    }
}

And it refreshes upon install on windows 7 fine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文