这是如何使用 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 执行此操作,请将控件添加到页面,最初使用折叠可见性。在要显示的场景中,将可见性更改为可见。您需要弄清楚您希望 Control 以何种方式工作,并且您可能需要重写 OnBackKeyPress 以为用户提供关闭控件的逻辑方式。
protected override void OnBackKeyPress( System.ComponentModel.CancelEventArgs e )
{
if (myControl.Visibility == Visibility.Visible)
{
e.Cancel = true;
myControl.Visibility = Visibility.Collapsed;
}
}