【问题标题】:Show and hide Statusbar in Windows Phone 8.1 just work first time在 Windows Phone 8.1 中显示和隐藏状态栏只是第一次工作
【发布时间】:2015-01-13 06:25:19
【问题描述】:

我在将互联网上的内容加载到应用程序时使用状态栏。我在 App.xaml.cs 中有两个函数用于隐藏和显示,但是当我调用 HideProgressAsync() 一次时,下次调用 ShowProgressAsync 时,状态栏不会显示。我究竟做错了什么?缺少标志?

    public async Task ShowProgressAsync(string message)
    {
        var statusBar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView();              
        statusBar.ProgressIndicator.Text = message;
        await statusBar.ProgressIndicator.ShowAsync();
    }

    public async Task HideProgressAsync()
    {
        var statusBar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView();
        await statusBar.HideAsync();
    }

【问题讨论】:

    标签: c# asynchronous windows-phone-8.1 statusbar


    【解决方案1】:

    代码问题,在上面的代码中我隐藏了整个状态栏。下面是正确的代码

    public async Task HideProgressAsync()
    {
        var statusBar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView();
        await statusBar.ProgressIndicator.HideAsync();
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-05-25
      • 1970-01-01
      • 1970-01-01
      • 2014-10-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多