0

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;
        }
    }
4

1 に答える 1

4

イベントの代わりにイベントハンドラー内に配置this.ApplicationBar.IsVisible = true;します_worker.RunWorkerCompletedLoaded

于 2012-03-13T15:07:07.903 に答える