Windows 8.1ストアアプリのチャームメニューにログアウトオプションがあります。ユーザーがチャーム メニューのログアウト オプションをクリックすると、サービス コールが発生します。
上記の場合、アプリケーション画面に読み込み進行状況バーを表示する必要があります。私の問題は、ユーザーがアプリケーションのどの画面でもかまいません
同じことを達成する一般的な方法はありますか?
Windows 8.1ストアアプリのチャームメニューにログアウトオプションがあります。ユーザーがチャーム メニューのログアウト オプションをクリックすると、サービス コールが発生します。
上記の場合、アプリケーション画面に読み込み進行状況バーを表示する必要があります。私の問題は、ユーザーがアプリケーションのどの画面でもかまいません
同じことを達成する一般的な方法はありますか?
私のアプリにも同様の機能があります。ボタンがタップ/クリックされると (FlyOut で、Charm で直接ではなく)、公的にアクセス可能な 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 用の新しい Control FlyOut があるので、UserControl の代わりにそれを使用できます。
ところで、これらのガイドラインによれば、エントリ ポイントから直接アクションを実行するべきではありません。