首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Charm menu注销服务呼叫的加载指示器

Charm menu注销服务呼叫的加载指示器
EN

Stack Overflow用户
提问于 2013-09-17 19:33:40
回答 1查看 101关注 0票数 1

我在windows8.1商店应用程序的Charm菜单中有注销选项。当用户单击charm菜单中的注销选项时,我正在点击服务呼叫。

在上述情况下,我应该在应用程序屏幕中显示加载进度条。我的问题是用户可以是我的应用程序中的任何屏幕

有没有什么通用的方法来实现同样的目标呢?

EN

回答 1

Stack Overflow用户

发布于 2013-09-18 20:43:31

我的应用程序中也有类似的功能。当点击/点击按钮时(在FlyOut中,而不是直接在咒语中),一个可公开访问的Sub (在模块中,例如)将被执行:

代码语言:javascript
运行
复制
Public Sub OpenModalBackground(Optional ByVal strProgressText As String = "")
    pupModalBackground = New Popup
    pupModalBackground.IsLightDismissEnabled = False
    pupModalBackground.Width = Window.Current.Bounds.Width
    pupModalBackground.Height = Window.Current.Bounds.Height

    Dim foModalBackground As New FlyOuts.ModalBackground
    foModalBackground.Width = Window.Current.Bounds.Width
    foModalBackground.Height = Window.Current.Bounds.Height
    foModalBackground.ProgressText = strProgressText
    pupModalBackground.Child = foModalBackground

    pupModalBackground.SetValue(Canvas.LeftProperty, 0)
    pupModalBackground.SetValue(Canvas.TopProperty, 0)
    pupModalBackground.IsOpen = True
End Sub

如您所见,生成了一个新的PopUp,并加载了一个"FlyOut“(UserControl) ModalBackground,如下所示:

代码语言:javascript
运行
复制
<Grid Background="#BF000000">
    <StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Center">
        <ProgressRing IsActive="True" Foreground="White" Width="50" Height="50" HorizontalAlignment="Center"/>
        <TextBlock FontSize="15" FontWeight="SemiLight" Margin="0,20,0,0" HorizontalAlignment="Center" Text="{Binding ProgressText}"/>
    </StackPanel>
</Grid>

它对我来说运行得很好。据我所知,Win8.1有一个新的控件FlyOut,所以你可以用它来代替UserControl。

顺便说一句:根据这些Guidelines,您不应该从入口点执行直接操作。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18848773

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档