/// <summary>
        /// Constructor which initializes properties and using input surveyId like ID of survey.
        /// </summary>
        /// <param name="surveyId">ID of survey.</param>
        public SurveyViewModel(string surveyId)
        {
            ListOfResults = new ObservableCollection<ResultBasicInfo>();
            _operations = new OperationsOnListOfResults(surveyId, ListOfResults);
            SurveyId = surveyId;
            ProgressBar = new ProcessingBar();
            Message = new DialogBox();
            _resultSender = new SendResult();
            _resultSender.SendingCompleted += (object sender, EventArgs args) =>
            {
                System.Windows.Deployment.Current.Dispatcher.BeginInvoke(() =>
                {
                    SendResult.SendingEventArgs.SendingStatus status = (args as SendResult.SendingEventArgs).Status;
                    string resultId = (args as SendResult.SendingEventArgs).ResultId;
                    switch (status)
                    {
                        case Model.SendResult.SendingEventArgs.SendingStatus.Sent:
                            Message.Show(Languages.AppResources.surveyViewModel_sendingCompleted);
                            _operations.MarkResultAsSent(resultId);
                            break;
                        case Model.SendResult.SendingEventArgs.SendingStatus.ServerError:
                            Message.Show(Languages.AppResources.surveyViewModel_serverError);
                            break;
                        case Model.SendResult.SendingEventArgs.SendingStatus.UnknownError:
                            Message.Show(Languages.AppResources.surveyViewModel_unknownError);
                            break;
                        case Model.SendResult.SendingEventArgs.SendingStatus.Canceled:
                            break;
                    }

                    ProgressBar.IsEnabled = false;
                    SendingInProgress = false;
                });
            };
        }
 /// <summary>
 /// Initializes all data members. Allows to set parent category.
 /// </summary>
 /// <param name="parent"><see cref="Category"/> instance that question belongs to.</param>
 public ImageQuestion(Category parent)
 {
     Parent = parent;
     _isEnabled = true;
     IsCorrectAnswer = true;
     Message = new DialogBox();
     ImageItems = new ObservableCollection<ImageItem>();
     ChooserTask = new PhotoChooserTask();
     CameraTask = new CameraCaptureTask();
     ChooserTask.Completed += TaskCompletedCallback;
     CameraTask.Completed += TaskCompletedCallback;
 }
 /// <summary>
 /// Method to display standard WP7 MessageBox.
 /// </summary>
 /// <param name="box">Contain information about MessageBox (e.g. title, message field, type of button).</param>
 public static void AssignDisplay(DialogBox box)
 {
     box.DialogBoxEvent += (object sender, EventArgs args) =>
     {
         if (box.Title != null)
         {
             box.Result = MessageBox.Show(box.Field, box.Title, box.ButtonType);
         }
         else
         {
             box.Result = MessageBox.Show(box.Field);
         }
     };
 }
        private OperationsOnSettings()
        {
            SettingUnit = new SettingEntity();
            Message = new DialogBox();

            try
            {
                if (!IsolatedStorageSettings.ApplicationSettings.Contains("_isSetSettings"))
                {
                    DefaultSettings();
                }
            }
            catch (IsolatedStorageException)
            {
                Message.Show(Languages.AppResources.settings_IsolatedStorageFailed);
            }
        }
 /// <summary>
 /// Method to display customize DialogBox with options Yes/No.
 /// </summary>
 /// <param name="box">Contain information about MessageBox (e.g. title, message field)</param>
 public static void AssignYesNoMessage(DialogBox box)
 {
     box.YesNoMessageEvent += (object sender, EventArgs args) =>
     {
         YesNoMessageBox messageBox = new YesNoMessageBox();
         messageBox.Message = box.Field;
         messageBox.Title = box.Title;
         messageBox.Completed += (object YesNosender, EventArgs completedArgs) =>
         {
             box.YesNoResponse = (YesNosender as YesNoMessageBox).Response;
             if (box.YesNoAnswerCompleted != null)
             {
                 box.YesNoAnswerCompleted(sender, args);
             }
         };
         messageBox.Show();
     };
 }
 /// <summary>
 /// Initializes all necessary data objects.
 /// </summary>
 public DownloadListStatus()
 {
     ProgressBar = new ProcessingBar();
     Message = new DialogBox();
 }
 /// <summary>
 /// Initializes all necessary data objects.
 /// </summary>
 public TestConnection()
 {
     Message = new DialogBox();
     Busy = new ProcessingBar(Languages.AppResources.operationsOnRegistration_ProcessingBarInformation);
 }