private static MetroDialogBoxMessage ProductStillBlocked()
        {
            var vm = new BasicModalViewModel
                         {
                             Title = "Product could not be blocked",
                             Content = "There was in error in blocking this update."
                         };
            vm.SetViaButtonDescriptions(new List<ButtonDescription>
                                            {
                                                new ButtonDescription
                                                    {
                                                        Title
                                                            =
                                                            "Continue"
                                                    }
                                            });

            return new MetroDialogBoxMessage {ModalViewModel = vm};
        }
        public AskToCreateEventViewModel()
        {
            Title = "Automatically update CoApp packages?";
            UpdateService = new LocalServiceLocator().UpdateService;
            CoAppService = new LocalServiceLocator().CoAppService;
            ElevateSetScheduledTask = new RelayCommand(RunElevateSetScheduleTask);
            DontScheduleTask = new RelayCommand(Leave);
            SetScheduledTask = new RelayCommand(() =>
                                                    {
                                                        UpdateService.SetDefaultScheduledTask().ContinueWith(t =>
                                                                                                                 {
                                                                                                                     if
                                                                                                                         (
                                                                                                                         t
                                                                                                                             .
                                                                                                                             IsCanceled ||
                                                                                                                         t
                                                                                                                             .
                                                                                                                             IsFaulted)
                                                                                                                     {
                                                                                                                         Logger
                                                                                                                             .
                                                                                                                             Error
                                                                                                                             ("We couldn't set update task. {0} {1}",
                                                                                                                              t
                                                                                                                                  .
                                                                                                                                  Exception
                                                                                                                                  .
                                                                                                                                  Message,
                                                                                                                              t
                                                                                                                                  .
                                                                                                                                  Exception
                                                                                                                                  .
                                                                                                                                  StackTrace);

                                                                                                                         var
                                                                                                                             modalModel
                                                                                                                                 = new BasicModalViewModel
                                                                                                                                       {
                                                                                                                                           Title
                                                                                                                                               =
                                                                                                                                               "We couldn't set update task",
                                                                                                                                           Content
                                                                                                                                               =
                                                                                                                                               "The update task couldn't be set",
                                                                                                                                       };
                                                                                                                         modalModel
                                                                                                                             .
                                                                                                                             SetViaButtonDescriptions
                                                                                                                             (new List
                                                                                                                                  <
                                                                                                                                  ButtonDescription
                                                                                                                                  >
                                                                                                                                  {
                                                                                                                                      new ButtonDescription
                                                                                                                                          {
                                                                                                                                              Title
                                                                                                                                                  =
                                                                                                                                                  "Continue"
                                                                                                                                          }
                                                                                                                                  });

                                                                                                                         MessengerInstance
                                                                                                                             .
                                                                                                                             Send
                                                                                                                             (
                                                                                                                                 new MetroDialogBoxMessage
                                                                                                                                     {
                                                                                                                                         ModalViewModel
                                                                                                                                             =
                                                                                                                                             modalModel
                                                                                                                                     }
                                                                                                                             );
                                                                                                                     }

                                                                                                                     Leave
                                                                                                                         ();
                                                                                                                 });
                                                    });
        }
        private static MetroDialogBoxMessage NotEnoughPermissions()
        {
            var vm = new BasicModalViewModel
                         {Title = "Permissions problem", Content = "You don't have permission to block packages."};
            vm.SetViaButtonDescriptions(new List<ButtonDescription>
                                            {
                                                new ButtonDescription
                                                    {
                                                        Title
                                                            =
                                                            "Continue"
                                                    }
                                            });

            return new MetroDialogBoxMessage {ModalViewModel = vm};
        }
        private void RunElevateFailed(Exception e)
        {
            Logger.Warning("Elevation Failed {0}, {1}", e.Message, e.StackTrace);
            var modalModel = new BasicModalViewModel
                                 {
                                     Title
                                         =
                                         "Permission problem",
                                     Content
                                         =
                                         "You don't have permission to set a scheduled task. Sorry :(",
                                 };
            modalModel.SetViaButtonDescriptions(new List<ButtonDescription>
                                                    {
                                                        new ButtonDescription
                                                            {
                                                                Title
                                                                    =
                                                                    "Continue"
                                                            }
                                                    });
            MessengerInstance
                .
                Send
                (new MetroDialogBoxMessage
                     {
                         ModalViewModel = modalModel
                     });

            Leave();
        }