示例#1
0
        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.
        /// This parameter is typically used to configure the page.</param>
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            Stopwatch stopwatch = Stopwatch.StartNew();
            EventsCategoryViewModel eventsCategoryViewModel = await EventsCategoryViewModel.CreateTaskAsync();

            EventsCategoryView.ItemsSource = eventsCategoryViewModel.Items;
            stopwatch.Stop();
            await new MessageDialog("Time elapsed = " + stopwatch.ElapsedMilliseconds).ShowAsync();
        }
        public static Task <EventsCategoryViewModel> CreateTaskAsync()
        {
            EventsCategoryViewModel eventsCategoryViewModel = new EventsCategoryViewModel();

            return(eventsCategoryViewModel.InitializeAsync());
        }