ApplicationBar WP7

本文关键字:WP7 ApplicationBar | 更新日期: 2023-09-27 18:27:50

我想知道为什么当我加载windows phone项目时,应用程序栏会出现在我的第一个屏幕上,而这只是一个加载背景。

我怎样才能使它出现在加载的真正末尾?

这是我使用的代码:

public MainPage()
    {
        InitializeComponent();
        AnimationContext = LayoutRoot;  //  for page transitions
        _tappedListBox = null;   //  used for setting the activated ListBox on panorama for animation to map page
        // If the constructor has been called, this is not a page that was already in memory:
        _newPageInstance = true;
        //  Setup the background thread worker properties:
        _worker = new BackgroundWorker();   //  Create a background thread worker for downloading/installing park maps
        _worker.WorkerReportsProgress = true;
        _worker.WorkerSupportsCancellation = true;
        _worker.DoWork += new DoWorkEventHandler(worker_DoWork);
        _worker.ProgressChanged += new ProgressChangedEventHandler(worker_ProgressChanged);
        _worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted);
        // Set the data context of the listbox control to the sample data
        this.DataContext = App.ViewModel;
        this.Loaded += new RoutedEventHandler(MainPage_Loaded);

    }

我在这里设置了可见性:

    private void MainPage_Loaded(object sender, RoutedEventArgs e)
    {
        if (!App.ViewModel.IsDataLoaded)
            App.ViewModel.LoadData();
        ;   //  load panorama data (if need to)
        if (!App.ViewModel.IsDataLoaded == false)
        {
            this.ApplicationBar.IsVisible = true;
        }
    }

ApplicationBar WP7

this.ApplicationBar.IsVisible = true;放入_worker.RunWorkerCompleted事件处理程序,而不是Loaded事件