Esempio n. 1
0
        public MainWindow()
        {
            // Init
            _openAthletes = new ObservableCollection <Athlete>();

            InitializeComponent();

            // Set culture
            CultureInfo.DefaultThreadCurrentCulture   = new CultureInfo("pt-PT");
            CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo("pt-PT");

            BindingOperations.GetBinding(MinDateRange, DatePicker.SelectedDateProperty)?.ValidationRules.Add(SliderRange.MinDateValidator);
            BindingOperations.GetBinding(MaxDateRange, DatePicker.SelectedDateProperty)?.ValidationRules.Add(SliderRange.MaxDateValidator);

            OpenAthletesList.ItemsSource            = _openAthletes; // empty on start
            ModalityList.ItemsSource                = Modalities.GetModalities();
            AthletesWithOpenEvaluations.ItemsSource = Athletes.AthletesWithOpenEvaluations();

            // Modal
            EvaluationModal.PreviewMouseUp += delegate { if (!_withinMarkPopup)
                                                         {
                                                             BodyChartMarkPopup.IsPopupOpen = false;
                                                         }
            };
        }
Esempio n. 2
0
        private void SaveSession(object sender, RoutedEventArgs e)
        {
            var ms = EvaluationModal.DataContext as ModalState;

            if (ms == null)
            {
                return;
            }

            ms.Save();
            SessionModal.IsOpen = false;  // close the modal

            /* Update the athlete's home list */
            AthletesWithOpenEvaluations.ItemsSource = Athletes.AthletesWithOpenEvaluations();
            /* Update the athlete's content */
            AthleteContent.DataContext = null; AthleteContent.DataContext = ms.Athlete;
            /* Update the sessions' lists */
            EvaluationsList.ItemsSource = ms.Athlete.GetEvaluations();
            OpenSessions(ms.Evaluation, null);
            FilterEvaluations();
        }