public NewCountdown()
        {
            InitializeComponent();

            viewModel = this.DataContext as NewCountdownViewModel;

            // UI Control Events
            PhotoLibraryPicker.Click += new RoutedEventHandler(PhotoLibraryPicker_Click);

            photoChooserTask = new PhotoChooserTask();
            photoChooserTask.Completed += photoChooserTask_Completed;

            unitListPicker.SummaryForSelectedItemsDelegate = SummarizeItems;
        }
        private void appBarAddButton_Click(object sender, EventArgs e)
        {
            try
            {
                UpdateChangesToObject();
                viewModel.AddCountdownItem();

                App.FileOpenPickerContinuationEventArgs = null;
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                viewModel = null;
            }

            // Return to the main page.
            if (NavigationService.CanGoBack)
            {
                SimpleIoc.Default.Unregister<NewCountdownViewModel>();
                SimpleIoc.Default.Register<NewCountdownViewModel>();

                NavigationService.GoBack();
            }
        }