ListBox を備えたアプリがあります。ユーザーが項目をタップすると、MVVM メソッドを呼び出す新しいページが起動し、ListBox がいっぱいになります。ユーザーが最初の ListBox をタップすると、すぐにページが変更されず、2 ~ 3 秒待ってから新しいページが表示され、応答しません。ProgressIndicator を表示し、新しいリストを埋める新しいページをアクティブにするにはどうすればよいですか? 2 番目のリストのコードは次のとおりです。
protected override async void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
base.OnNavigatedTo(e);
int id;
if (NavigationContext.QueryString.ContainsKey("id"))
{
id = Convert.ToInt16(NavigationContext.QueryString["id"]);
SystemTray.SetIsVisible(this, true);
SystemTray.SetOpacity(this, 0.5);
progressIndicator = new ProgressIndicator();
progressIndicator.IsVisible = true;
progressIndicator.IsIndeterminate = true;
SystemTray.SetProgressIndicator(this, progressIndicator);
var x=await App.viewModel.MyDBMethod(id);
this.DataContext = App.viewModel;
this.mPivot.SelectedIndex = 0;
progressIndicator.IsVisible = false;
progressIndicator.IsIndeterminate = false;
}
}
}