/// <summary>
 /// Code to execute when ViewModel initialization completes
 /// </summary>
 private void OnViewModelInitialization(object sender, InitializationCompletedEventArgs e)
 {
     this.Dispatcher.BeginInvoke(() =>
     {
         //If initialization has failed show error message and return
         if (e.Error != null)
         {
             MessageBox.Show(e.Error.Message, e.Error.GetType().Name, MessageBoxButton.OK);
         }
     });
 }
Example #2
0
        /// <summary>
        /// Code to execute when ViewModel initialization completes
        /// </summary>
        private void OnViewModelInitialization(object sender, InitializationCompletedEventArgs e)
        {
            this.Dispatcher.BeginInvoke(() =>
            {
                //If initialization has failed, show error message and return
                if (e.Error != null)
                {
                    MessageBox.Show(e.Error.Message, e.Error.GetType().Name, MessageBoxButton.OK);
                    return;
                }

                App.MainViewModel.LoadData(((PivotItem)Views.SelectedItem).Name);
            });
        }
Example #3
0
        /// <summary>
        /// Code to execute when ViewModel initialization completes
        /// </summary>
        /// <param name="sender" />
        /// <param name="e" />
        void OnViewModelInitialization(object sender, InitializationCompletedEventArgs e)
        {
            this.Dispatcher.BeginInvoke(() =>
            {
                //If initialization has failed show error message and return
                if (e.Error != null)
                {
                    MessageBox.Show(e.Error.Message, e.Error.GetType().Name, MessageBoxButton.OK);
                }

                //Set Page's DataCotext to current ViewModel instance
                this.DataContext = (sender as NewItemViewModel);
            });
        }
Example #4
0
        /// <summary>
        /// Code to execute when ViewModel initialization completes
        /// </summary>
        private void OnViewModelInitialization(object sender, InitializationCompletedEventArgs e)
        {
            this.Dispatcher.BeginInvoke(() =>
            {
                //If initialization has failed, show error message and return
                if (e.Error != null)
                {
                    MessageBox.Show(e.Error.Message, e.Error.GetType().Name, MessageBoxButton.OK);
                    return;
                }

                App.MainViewModel.LoadData(((PivotItem)Views.SelectedItem).Name);
                this.DataContext = (sender as ListViewModel);
            });

            // Open notification channel here if user has chosen to subscribe to notifications.
            if (Notifications.GetRegistrationStatus() == true)
            {
                Notifications.OpenNotificationChannel(false);
            }
        }
        /// <summary>
        /// Code to execute when ViewModel initialization completes
        /// </summary>
        /// <param name="sender" />
        /// <param name="e" />
        private void OnViewModelInitialization(object sender, InitializationCompletedEventArgs e)
        {
            this.Dispatcher.BeginInvoke(() =>
            {
                //If initialization has failed show error message and return
                if (e.Error != null)
                {
                    MessageBox.Show(e.Error.Message, e.Error.GetType().Name, MessageBoxButton.OK);
                    return;
                }

                //Set Page's DataContext to current ViewModel instance
                this.DataContext = (sender as DisplayItemViewModel);
            });
        }
        /// <summary>
        /// Code to execute when ViewModel initialization completes
        /// </summary>
        private void OnViewModelInitialization(object sender, InitializationCompletedEventArgs e)
        {
            this.Dispatcher.BeginInvoke(() =>
            {
                //If initialization has failed, show error message and return
                if (e.Error != null)
                {
                    MessageBox.Show(e.Error.Message, e.Error.GetType().Name, MessageBoxButton.OK);
                    return;
                }

                App.OrdersListViewModel.LoadData(((PivotItem)Views.SelectedItem).Name);
                this.DataContext = (sender as ListViewModel);
            });
        }
 /// <summary>
 /// Code to execute when ViewModel initialization completes
 /// </summary>
 /// <param name="sender" />
 /// <param name="e" />
 private void OnViewModelInitialization(object sender, InitializationCompletedEventArgs e)
 {
     this.Dispatcher.BeginInvoke(() =>
     {
         //If initialization has failed show error message and return
         if (e.Error != null)
         {
             MessageBox.Show(e.Error.Message, e.Error.GetType().Name, MessageBoxButton.OK);
         }
     });
 }
        /// <summary>
        /// Code to execute when ViewModel initialization completes
        /// </summary>
        private void OnViewModelInitialization(object sender, InitializationCompletedEventArgs e)
        {
            this.Dispatcher.BeginInvoke(() =>
            {
                //If initialization has failed, show error message and return
                if (e.Error != null)
                {
                    MessageBox.Show(e.Error.Message, e.Error.GetType().Name, MessageBoxButton.OK);
                    return;
                }

                App.MainViewModel.LoadData(((PivotItem)Views.SelectedItem).Name);
                this.DataContext = (sender as ListViewModel);
            });

            // Open notification channel here if user has chosen to subscribe to notifications.
            if (Notifications.GetRegistrationStatus() == true)
            {
                Notifications.OpenNotificationChannel(false);
            }
        }