Example #1
0
        /// <summary>
        /// Event handler called when the user cliks the Finished button.
        /// </summary>
        /// <param name="sender">The object that fired this event.</param>
        /// <param name="e">The Event Arguments associated with this event.</param>
        private void OnFinishedClicked(object sender, EventArgs e)
        {
            // Begin the fade navigation to indicate loading.
            OpenPopup();

            // Retrieve the InitialCategories selected by the user.
            IList selectedItems = CategorySelection.SelectedItems as IList;

            if (selectedItems.Count > 0)
            {
                // Begin loading the Initial Categories selected by the user.
                try
                {
                    _initialCategories.LoadSelection(selectedItems);
                }
                catch (WebException)
                {
                    _errorText.Visibility = Visibility.Visible;

                    DispatcherTimer dt = new DispatcherTimer();
                    dt.Interval = TimeSpan.FromSeconds(3D);
                    dt.Tick    +=
                        (s, a) =>
                    {
                        ClosePopup();
                        dt.Stop();
                    };
                    dt.Start();
                }
            }
            else
            {
                OnAllDownloadsFinished(sender, null);
            }
        }