且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我应该何时在 Windows Phone 8 应用程序中加载数据?

更新时间:2022-01-10 23:42:10

我通常在 XAML 中直接绑定到 ViewModel.然后在 OnNavigatedTo 我触发视图模型以异步获取其数据.

I usualy bind to a ViewModel directly in XAML. Then in OnNavigatedTo I trigger the view model to fetch its data async.

这允许我从一开始就显示基本值(页面标题等).然后,当我开始获取数据时,我还可以直接在 ViewModel 中激活进度条,然后在获取数据后将其删除.

This allows me to show basic values from start (page title etc.). Then when I start fetching the data I can also activate a progressbar directly in the ViewModel and then remove it once the data is fetched.