Exemple #1
0
        public override void OnViewModelLoadedOverride()
        {
            _tableView.AddDescriptionCell(PowerPlannerResources.GetString("Settings_SchoolTimeZone_Description.Text"));

            _tableView.StartNewGroup();

            var selectedTimeZone = new BareUIInlinePickerView(this, left: 16, right: 16)
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                HeaderText  = "Time zone",
                ItemsSource = ViewModel.AvailableTimeZones,
                ItemToPreviewStringConverter = item => SchoolTimeZoneSettingsViewModel.Format(item as TimeZoneInfo),
                ItemToViewConverter          = ConvertTimeZoneToInlineView
            };

            BindingHost.SetSelectedItemBinding(selectedTimeZone, nameof(ViewModel.SelectedSchoolTimeZone));
            var cellSelectedTimeZone = new BareUITableViewCell("selectedTimeZone");

            cellSelectedTimeZone.ContentView.Add(selectedTimeZone);
            selectedTimeZone.StretchWidth(cellSelectedTimeZone.ContentView);
            selectedTimeZone.SetHeight(44);
            _tableView.AddCell(cellSelectedTimeZone, delegate { }); // Have to provide action so it remains clickable

            _tableView.StartNewGroup();

            _tableView.AddCell("Save changes", ViewModel.Save);

            _tableView.AddCaptionDescriptionCell(PowerPlannerResources.GetString("Settings_SchoolTimeZone_RestartNote.Text"));

            _tableView.Compile();

            base.OnViewModelLoadedOverride();
        }
Exemple #2
0
        private void UpdateTable()
        {
            _tableView.ClearAll();

            // Display summary info
            _tableView.AddDescriptionCell("Edit grade options for this class.");

            _tableView.StartNewGroup();

            // Add items
            _tableView.AddValueCell(PowerPlannerResources.GetString("ClassPage_TextBoxEditCredits.Header"),
                                    bindingHost: m_classBindingHost,
                                    bindingValuePropertyName: nameof(ViewModel.Class.Credits),
                                    converter: ConvertCreditsToString,
                                    invokeAction: ViewModel.ConfigureCredits);

            _tableView.AddCell(PowerPlannerResources.GetString("ConfigureClassGrades_Items_WeightCategories.Title"), ViewModel.ConfigureWeightCategories);

            _tableView.AddValueCell(PowerPlannerResources.GetString("Settings_GradeOptions_ListItemGpaType.Title"),
                                    bindingHost: m_classBindingHost,
                                    bindingValuePropertyName: nameof(ViewModel.Class.GpaType),
                                    converter: ConvertGpaTypeToString,
                                    invokeAction: ViewModel.ConfigureGpaType);

            if (ViewModel.Class.GpaType == PowerPlannerSending.GpaType.PassFail)
            {
                _tableView.AddValueCell(PowerPlannerResources.GetString("Settings_GradeOptions_ListItemPassingGrade.Title"),
                                        bindingHost: m_classBindingHost,
                                        bindingValuePropertyName: nameof(ViewModel.Class.PassingGrade),
                                        converter: (val) => { return(((double)val).ToString("0.##%")); },
                                        invokeAction: ViewModel.ConfigurePassingGrade);
            }
            else
            {
                _tableView.AddCell(PowerPlannerResources.GetString("ConfigureClassGrades_Items_GradeScale.Title"), ViewModel.ConfigureGradeScale);
            }

            _tableView.AddValueCell(PowerPlannerResources.GetString("ClassPage_TextBlockAverageGradesHelpHeader.Text"),
                                    bindingHost: m_classBindingHost,
                                    bindingValuePropertyName: nameof(ViewModel.Class.ShouldAverageGradeTotals),
                                    converter: ConvertBooleanToYesNo,
                                    invokeAction: ViewModel.ConfigureAverageGrades);

            _tableView.AddValueCell(PowerPlannerResources.GetString("ClassPage_TextBlockRoundGradesUpHelpHeader.Text"),
                                    bindingHost: m_classBindingHost,
                                    bindingValuePropertyName: nameof(ViewModel.Class.DoesRoundGradesUp),
                                    converter: ConvertBooleanToYesNo,
                                    invokeAction: ViewModel.ConfigureRoundGradesUp);

            _tableView.Compile();
        }
Exemple #3
0
        public override void OnViewModelLoadedOverride()
        {
            _tableView.AddDescriptionCell("Power Planner automatically sets reminders for each task and event.");

            _tableView.StartNewGroup();

            var switchDayBefore = new BareUISwitch()
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                Header = "Day Before"
            };

            BindingHost.SetSwitchBinding(switchDayBefore, nameof(ViewModel.RemindersDayBefore));
            var cellDayBefore = new BareUITableViewCell("dayBefore");

            cellDayBefore.ContentView.Add(switchDayBefore);
            switchDayBefore.StretchWidthAndHeight(cellDayBefore.ContentView);
            _tableView.AddCell(cellDayBefore, delegate { }); // Have to provide action so it remains clickable

            _tableView.AddCaptionDescriptionCell("This reminds you the day before your incomplete tasks or events are due. It will remind you 10 minutes after your last class, or at 3:00 PM if you don't have any classes that day.");

            _tableView.StartNewGroup();

            var switchDayOf = new BareUISwitch()
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                Header = "Day Of"
            };

            BindingHost.SetSwitchBinding(switchDayOf, nameof(ViewModel.RemindersDayOf));
            var cellDayOf = new BareUITableViewCell("dayOf");

            cellDayOf.ContentView.Add(switchDayOf);
            switchDayOf.StretchWidthAndHeight(cellDayOf.ContentView);
            _tableView.AddCell(cellDayOf, delegate { });

            _tableView.AddCaptionDescriptionCell("This reminds you on the same day that your incomplete tasks or events are due. It will remind you 1 hour before your class starts, or at 6:00 PM if your class doesn't meet on that day.");

            _tableView.Compile();

            base.OnViewModelLoadedOverride();
        }
        public override void OnViewModelLoadedOverride()
        {
            _tableView.AddDescriptionCell(PowerPlannerResources.GetString("Settings_TwoWeekSchedule_Description.Text"));

            _tableView.StartNewGroup();

            var currentWeek = new BareUIInlinePickerView(this, left: 16, right: 16)
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                HeaderText  = "Current week",
                ItemsSource = ViewModel.AvailableCurrentWeekStrings
            };

            BindingHost.SetSelectedItemBinding(currentWeek, nameof(ViewModel.CurrentWeekString));
            var cellCurrentWeek = new BareUITableViewCell("currentWeek");

            cellCurrentWeek.ContentView.Add(currentWeek);
            currentWeek.StretchWidth(cellCurrentWeek.ContentView);
            currentWeek.SetHeight(44);
            _tableView.AddCell(cellCurrentWeek, delegate { }); // Have to provide action so it remains clickable

            _tableView.StartNewGroup();

            var weekChangesOn = new BareUIInlinePickerView(this, left: 16, right: 16)
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                HeaderText  = "Week changes on",
                ItemsSource = ViewModel.AvailableWeekChangesOnStrings
            };

            BindingHost.SetSelectedItemBinding(weekChangesOn, nameof(ViewModel.WeekChangesOnString));
            var cellWeekChangesOn = new BareUITableViewCell("weekChangesOn");

            cellWeekChangesOn.ContentView.Add(weekChangesOn);
            weekChangesOn.StretchWidth(cellWeekChangesOn.ContentView);
            weekChangesOn.SetHeight(44);
            _tableView.AddCell(cellWeekChangesOn, delegate { });

            _tableView.Compile();

            base.OnViewModelLoadedOverride();
        }