我在windows8.1商店应用程序的Charm菜单中有注销选项。当用户单击charm菜单中的注销选项时,我正在点击服务呼叫。
在上述情况下,我应该在应用程序屏幕中显示加载进度条。我的问题是用户可以是我的应用程序中的任何屏幕
有没有什么通用的方法来实现同样的目标呢?
发布于 2013-09-18 20:43:31
我的应用程序中也有类似的功能。当点击/点击按钮时(在FlyOut中,而不是直接在咒语中),一个可公开访问的Sub (在模块中,例如)将被执行:
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,如下所示:
<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,您不应该从入口点执行直接操作。
https://stackoverflow.com/questions/18848773
复制相似问题