public override void OnViewModelLoadedOverride()
        {
            FindViewById <Button>(Resource.Id.ButtonResetPassword).Click += delegate { ViewModel.ResetPassword(); };

            ViewModel.PropertyChanged += new WeakEventHandler <PropertyChangedEventArgs>(ViewModel_PropertyChanged).Handler;

            KeyboardHelper.FocusAndShow(FindViewById <EditText>(Resource.Id.EditTextUsername));
        }
        public override void OnViewModelLoadedOverride()
        {
            ViewModel.ActionError     += ViewModel_ActionError;
            ViewModel.PropertyChanged += ViewModel_PropertyChanged;

            UpdateState();

            KeyboardHelper.FocusAndShow(_editTextUsername);
        }
        public override void OnViewModelLoadedOverride()
        {
            ViewModel.PropertyChanged            += ViewModel_PropertyChanged;
            ViewModel.ActionError                += ViewModel_ActionError;
            ViewModel.ActionPasswordsDidNotMatch += ViewModel_ActionPasswordsDidNotMatch;

            UpdateState();

            KeyboardHelper.FocusAndShow(_editTextPassword);
        }
Beispiel #4
0
        public override void OnViewModelSetOverride()
        {
            ViewModel.AlertUserUpgradeAccountNeeded = AlertUserUpgradeAccountNeeded;
            ViewModel.PropertyChanged += new WeakEventHandler <PropertyChangedEventArgs>(ViewModel_PropertyChanged).Handler;

            FindViewById <Button>(Resource.Id.ButtonForgotUsername).Click += delegate { ViewModel.ForgotUsername(); };
            FindViewById <Button>(Resource.Id.ButtonForgotPassword).Click += delegate { ViewModel.ForgotPassword(); };

            KeyboardHelper.FocusAndShow(FindViewById <EditText>(Resource.Id.EditTextUsername));
        }
        public override void OnViewModelLoadedOverride()
        {
            FindViewById <Button>(Resource.Id.ButtonCreateAccount).Click        += ButtonCreateAccount_Click;
            FindViewById <Button>(Resource.Id.ButtonCreateOfflineAccount).Click += ButtonCreateOfflineAccount_Click;

            ViewModel.AlertConfirmationPasswordDidNotMatch = AlertConfirmationPasswordDidNotMatch;
            ViewModel.AlertNoEmail          = AlertNoEmail;
            ViewModel.AlertNoUsername       = AlertNoUsername;
            ViewModel.AlertPasswordTooShort = AlertPasswordTooShort;

            ViewModel.PropertyChanged += ViewModel_PropertyChanged;

            KeyboardHelper.FocusAndShow(FindViewById <EditText>(Resource.Id.EditTextUsername));
        }
Beispiel #6
0
        public override void OnViewModelLoadedOverride()
        {
            switch (ViewModel.State)
            {
            case AddYearViewModel.OperationState.Adding:
                Title = PowerPlannerResources.GetString("AddYearPage_Title_Adding");
                break;

            case AddYearViewModel.OperationState.Editing:
                Title = PowerPlannerResources.GetString("AddYearPage_Title_Editing");
                break;
            }

            if (ViewModel.Name.Length == 0)
            {
                KeyboardHelper.FocusAndShow(FindViewById <EditText>(Resource.Id.EditTextName));
            }
        }
Beispiel #7
0
        public override void OnViewModelLoadedOverride()
        {
            FindViewById <Button>(Resource.Id.ButtonDate).Click += ButtonDate_Click;

            _spinnerWeightCategory               = FindViewById <Spinner>(Resource.Id.SpinnerWeightCategory);
            _spinnerWeightCategory.Adapter       = SpinnerWeightCategoriesAdapter.Create(ViewModel.WeightCategories);
            _spinnerWeightCategory.ItemSelected += _spinnerWeightCategory_ItemSelected;
            UpdateSelectedWeightCategory();

            switch (ViewModel.State)
            {
            case AddGradeViewModel.OperationState.Adding:
                Title = PowerPlannerResources.GetString("EditGradePage_HeaderAddString");
                break;

            case AddGradeViewModel.OperationState.Editing:
                Title = PowerPlannerResources.GetString("EditGradePage_HeaderEditString");
                break;

            case AddGradeViewModel.OperationState.AddingWhatIf:
                Title = PowerPlannerResources.GetString("EditGradePage_HeaderAddWhatIfString");
                break;

            case AddGradeViewModel.OperationState.EditingWhatIf:
                Title = PowerPlannerResources.GetString("EditGradePage_HeaderEditWhatIfString");
                break;

            default:
                throw new NotImplementedException();
            }

            SetMenu(Resource.Menu.add_grade_menu);

            if (ViewModel.Name.Length == 0)
            {
                KeyboardHelper.FocusAndShow(FindViewById <EditText>(Resource.Id.EditTextName));
            }
            else if (ViewModel.GradeReceived == Grade.UNGRADED)
            {
                KeyboardHelper.FocusAndShow(FindViewById <EditText>(Resource.Id.EditTextGradeReceived));
            }
        }
Beispiel #8
0
        public override void OnViewModelLoadedOverride()
        {
            if (ViewModel.State == AddHolidayViewModel.OperationState.Adding)
            {
                Title = PowerPlannerResources.GetString("String_AddHoliday").ToUpper();
                SetMenu(Resource.Menu.add_holiday_menu);
            }
            else
            {
                Title = PowerPlannerResources.GetString("String_EditHoliday").ToUpper();
                SetMenu(Resource.Menu.edit_holiday_menu);
            }

            FindViewById <Button>(Resource.Id.ButtonStartDate).Click += ButtonStartDate_Click;
            FindViewById <Button>(Resource.Id.ButtonEndDate).Click   += ButtonEndDate_Click;

            if (ViewModel.Name.Length == 0)
            {
                KeyboardHelper.FocusAndShow(FindViewById <EditText>(Resource.Id.EditTextName));
            }
        }
Beispiel #9
0
        public override void OnViewModelLoadedOverride()
        {
            ViewModel.SupportsStartEnd = true;

            switch (ViewModel.State)
            {
            case AddSemesterViewModel.OperationState.Adding:
                Title = PowerPlannerResources.GetString("EditSemesterPage_Title_Adding");
                break;

            case AddSemesterViewModel.OperationState.Editing:
                Title = PowerPlannerResources.GetString("EditSemesterPage_Title_Editing");
                break;
            }

            FindViewById <Button>(Resource.Id.ButtonStartDate).Click += StartDate_Click;
            FindViewById <Button>(Resource.Id.ButtonEndDate).Click   += EndDate_Click;

            if (ViewModel.Name.Length == 0)
            {
                KeyboardHelper.FocusAndShow(FindViewById <EditText>(Resource.Id.EditTextName));
            }
        }
        public override void OnViewModelLoadedOverride()
        {
            switch (ViewModel.State)
            {
            case AddClassViewModel.OperationState.Editing:
                Title = PowerPlannerResources.GetString("AddClassPage_EditTitle");
                break;

            case AddClassViewModel.OperationState.Adding:
                Title = PowerPlannerResources.GetString("AddClassPage_AddTitle");
                break;
            }

            _colorPicker.SelectedColor = ColorTools.GetColor(ViewModel.Color);
            SetMenu(Resource.Menu.add_class_menu);

            FindViewById <Button>(Resource.Id.ButtonStartDate).Click += StartDate_Click;
            FindViewById <Button>(Resource.Id.ButtonEndDate).Click   += EndDate_Click;

            if (ViewModel.Name.Length == 0)
            {
                KeyboardHelper.FocusAndShow(FindViewById <EditText>(Resource.Id.EditTextName));
            }
        }
Beispiel #11
0
        public override void OnViewModelLoadedOverride()
        {
            FindViewById <Button>(Resource.Id.ButtonDate).Click += ButtonDate_Click;

            _spinnerClass               = FindViewById <Spinner>(Resource.Id.SpinnerClass);
            _spinnerClass.Adapter       = SpinnerClassesAdapter.Create(ViewModel.Classes);
            _spinnerClass.ItemSelected += _spinnerClass_ItemSelected;
            UpdateSelectedClass();

            _spinnerWeight = FindViewById <Spinner>(Resource.Id.SpinnerWeightCategory);
            AssignWeightCategoriesAdapter();
            _spinnerWeight.ItemSelected += _spinnerWeight_ItemSelected;
            UpdateSelectedWeight();

            _spinnerTimeOption = FindViewById <Spinner>(Resource.Id.SpinnerTimeOption);
            AssignTimeOptionsAdapter();
            _spinnerTimeOption.ItemSelected += _spinnerTimeOption_ItemSelected;

            switch (ViewModel.Type)
            {
            case AddHomeworkViewModel.ItemType.Homework:
                switch (ViewModel.State)
                {
                case AddHomeworkViewModel.OperationState.Adding:
                    Title = PowerPlannerResources.GetString("String_AddTask").ToUpper();
                    break;

                case AddHomeworkViewModel.OperationState.Editing:
                    Title = PowerPlannerResources.GetString("String_EditTask").ToUpper();
                    break;

                default:
                    throw new NotImplementedException();
                }
                break;

            case AddHomeworkViewModel.ItemType.Exam:
                switch (ViewModel.State)
                {
                case AddHomeworkViewModel.OperationState.Adding:
                    Title = PowerPlannerResources.GetString("String_AddEvent").ToUpper();
                    break;

                case AddHomeworkViewModel.OperationState.Editing:
                    Title = PowerPlannerResources.GetString("String_EditEvent").ToUpper();
                    break;

                default:
                    throw new NotImplementedException();
                }
                break;
            }

            FindViewById <Button>(Resource.Id.ButtonStartTime).Click += StartTime_Click;
            FindViewById <Button>(Resource.Id.ButtonEndTime).Click   += EndTime_Click;

            FindViewById <EditingImageAttachmentsWrapGrid>(Resource.Id.EditingImageAttachmentsWrapGrid).RequestedAddImage += AddHomeworkView_RequestedAddImage;

            ViewModel.PropertyChanged += new WeakEventHandler <PropertyChangedEventArgs>(ViewModel_PropertyChanged).Handler;

            SetMenu(Resource.Menu.add_homework_menu);

            if (ViewModel.Name.Length == 0)
            {
                KeyboardHelper.FocusAndShow(FindViewById <EditText>(Resource.Id.EditTextName));
            }
        }
        public override void OnViewModelLoadedOverride()
        {
            ViewModel.ActionIncorrectPassword += ViewModel_ActionIncorrectPassword;

            KeyboardHelper.FocusAndShow(FindViewById <EditText>(Resource.Id.EditTextPassword));
        }
Beispiel #13
0
        public override void OnViewModelLoadedOverride()
        {
            SetMenu(Resource.Menu.edit_class_details_menu);

            KeyboardHelper.FocusAndShow(FindViewById <EditText>(Resource.Id.EditTextDetails));
        }