これが MessageBox で適切に行われる方法のアイデアを次に示します。アプリ.xaml.cs:
public static bool IsFourthLaunch = false;
ApplicationLaunching(){
if (!IsolatedStorageSettings.ApplicationSettings.Contains("IsFourthLaunchDone"))
{
IsFourthLaunch = true;
}
}
MainPage.xaml.cs:
MainPage()
{
if (App.isFourthLaunch)
{
Loaded += OnFourthLaunch;
}
}
public void OnFourthLaunch(object sender, RoutedEventArgs e)
{
Loaded -= OnFourthLaunch;
if (App.IsFourthLaunch)
{
MessageBox.Show("To Enable Full screen mode, go to settings and select Full Screen Browsing.");
IsolatedStorageSettings.ApplicationSettings["IsFourthLaunchDone"] = true;
App.IsFourthLaunch = false;
}
}
UserControl を使用してこれを行うには、最初は折りたたみ表示でコントロールをページに追加します。表示するシナリオで、可視性を Visible に変更します。コントロールをどのように動作させたいかを理解する必要があり、おそらく OnBackKeyPress をオーバーライドして、ユーザーがコントロールを閉じるための論理的な方法を提供する必要があります。
protected override void OnBackKeyPress( System.ComponentModel.CancelEventArgs e )
{
if (myControl.Visibility == Visibility.Visible)
{
e.Cancel = true;
myControl.Visibility = Visibility.Collapsed;
}
}