/// <summary>
 /// Default constuctor which initializes component on page.
 /// </summary>
 public ResultsFilterPage()
 {
     InitializeComponent();
     _surveysViewModel = new ListOfSurveysViewModel();
     _surveysViewModel.Read();
     _filterViewModel    = new ResultsFilterViewModel(_surveysViewModel.List);
     Filters.DataContext = _filterViewModel.Filter;
     _filterViewModel.Filter.DateFiltration.ChosenDateFilter = "0";
     SurveySearchList.DataContext = _filterViewModel.Filter.SurveyFiltration.SelectedSurveys;
     BusyIndicator.DataContext    = _filterViewModel.Filter.Busy;
     _filterViewModel.Filter.SearchingCompletedEventHandler += OnSearchingCompleted;
     RadiusTextBox.ValidationRule = new RangeValidationRule(Model.SurveyForms.NumericQuestion.Types.DecimalType, 0, null);
     BuildApplicationBar();
 }
        /// <summary>
        /// Default constuctor which initializes component on page.
        /// </summary>
        public FilterListPage()
        {
            _filterViewModel = new ResultsFilterViewModel();
            InitializeComponent();
            BusyIndicator.DataContext = _filterViewModel.ProgressBar;
            ListOfSurveys.ItemsSource = App.AppDictionary["FilteredResults"] as ObservableCollection <ResultsFilter.GroupedOC <ResultBasicInfo> >;
            _filterViewModel.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:
                        MessageBox.Show(Languages.AppResources.surveyViewModel_sendingCompleted);
                        _filterViewModel.Operations.MarkResultAsSent(resultId);
                        _filterViewModel.Filter.ReloadResult(resultId);
                        break;

                    case Model.SendResult.SendingEventArgs.SendingStatus.ServerError:
                        MessageBox.Show(Languages.AppResources.surveyViewModel_serverError);
                        break;

                    case Model.SendResult.SendingEventArgs.SendingStatus.UnknownError:
                        MessageBox.Show(Languages.AppResources.surveyViewModel_unknownError);
                        break;

                    case Model.SendResult.SendingEventArgs.SendingStatus.Canceled:
                        break;
                    }
                    _filterViewModel.ProgressBar.IsEnabled = false;
                    _filterViewModel.IsSending             = false;
                });
            };
            BuildApplicationBar();
        }