コード例 #1
0
        /// <summary>
        /// Create the application tile
        /// </summary>
        /// <param name="task">Informations about the periodic task</param>
        protected override async void OnInvoke(ScheduledTask task)
        {
            try
            {
                // Update application tile
                ApplicationTileManager appTileManager = new ApplicationTileManager();
                await appTileManager.UpdateAsync();

                // Display toast notification if a new element has been published
                ToastManager manager = new NewsToastManager();
                await manager.CheckAndToastAsync();

                manager = new ConferenceToastManager();
                await manager.CheckAndToastAsync();

                manager = new ShowToastManager();
                await manager.CheckAndToastAsync();
            }
            finally
            {
                NotifyComplete();
            }
        }
コード例 #2
0
        /// <summary>
        /// Raised when the page is loaded
        /// </summary>
        /// <param name="e">Navigation event arguments</param>
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            if (_selectedPanoramaGroup != null)
            {
                int index = Panorama.Items.Cast<VisualGenericGroup>().TakeWhile(item => item != _selectedPanoramaGroup).Count();
                Panorama.DefaultItem = Panorama.Items[index];
            }

            if (e.NavigationMode == NavigationMode.New)
            {
                IMainViewModel viewModel = (IMainViewModel)DataContext;

                if (viewModel.LoadMenuCommand.CanExecute(this))
                {
                    viewModel.LoadMenuCommand.Execute(this);
                }

                BackgroundTaskRegistrationHelper taskRegistration = new BackgroundTaskRegistrationHelper();
                taskRegistration.Register();

                ApplicationTileManager tileManager = new ApplicationTileManager();
                await tileManager.UpdateAsync();
            }
        }