Example #1
0
        public RegisterPage()
        {
            InitializeComponent();
            if (Device.RuntimePlatform == Device.iOS)
            {
                ((NavigationPage)Application.Current.MainPage).BarBackgroundColor = Color.FromHex("#f37a3f");
                ((NavigationPage)Application.Current.MainPage).BarTextColor       = Color.White;
            }
            SetActivityIndicatorState(false);
            Entry_Registration_Key.Completed  += (s, e) => Entry_Username.Focus();
            Entry_Username.Completed          += (s, e) => Entry_Password.Focus();
            Entry_Password.Completed          += (s, e) => Entry_Password_Confirm.Focus();
            Entry_Password_Confirm.Completed  += (s, e) => Entry_First_Name.Focus();
            Entry_First_Name.Completed        += (s, e) => Entry_Last_Name.Focus();
            Entry_Last_Name.Completed         += (s, e) => GenderPicker.Focus();
            GenderPicker.SelectedIndexChanged += (s, e) =>
            {
                if (GenderPicker.SelectedIndex == -1)
                {
                    return;
                }
                else
                {
                    string profileTypeName = ProfileTypePicker.Items[ProfileTypePicker.SelectedIndex];
                    string profileTypeId   = ProfileTypes[profileTypeName];
                    if (profileTypeId.Equals("interpreter"))
                    {
                        Entry_Email.Focus();
                    }
                    else
                    {
                        NativeLanguagePicker.Focus();
                    }
                }
            };
            NativeLanguagePicker.SelectedIndexChanged += (s, e) => Entry_Email.Focus();
            Entry_Email.Completed        += (s, e) => Entry_Phone_Number.Focus();
            Entry_Phone_Number.Completed += (s, e) => Entry_Address.Focus();
            Entry_Address.Completed      += (s, e) => Entry_City.Focus();
            Entry_City.Completed         += (s, e) => Entry_Province.Focus();
            Entry_Province.Completed     += (s, e) => Entry_Zip_Code.Focus();

            foreach (String profileTypeName in ProfileTypes.Keys)
            {
                ProfileTypePicker.Items.Add(profileTypeName);
            }

            ProfileTypePicker.SelectedIndexChanged += (sender, args) =>
            {
                if (ProfileTypePicker.SelectedIndex == -1)
                {
                    return;
                }
                else
                {
                    string profileTypeName = ProfileTypePicker.Items[ProfileTypePicker.SelectedIndex];
                    string profileTypeId   = ProfileTypes[profileTypeName];
                    RegistrationLabel.IsVisible      = profileTypeId.Equals("interpreter") ? true : false;
                    Entry_Registration_Key.IsVisible = profileTypeId.Equals("interpreter") ? true : false;
                    LanguagePickerLabel.IsVisible    = profileTypeId.Equals("client") ? true : false;
                    NativeLanguagePicker.IsVisible   = profileTypeId.Equals("client") ? true : false;
                }
            };
            foreach (String genderName in Genders.Keys)
            {
                GenderPicker.Items.Add(genderName);
            }

            Languages = new ObservableCollection <LanguageModel>();
            LoadLanguagesAsync();

            this.BindingContext = this;
        }
Example #2
0
        public RegisterPage()
        {
            InitializeComponent();
            SetActivityIndicatorState(false);
            Entry_Registration_Key.Completed  += (s, e) => Entry_Username.Focus();
            Entry_Username.Completed          += (s, e) => Entry_Password.Focus();
            Entry_Password.Completed          += (s, e) => Entry_Password_Confirm.Focus();
            Entry_Password_Confirm.Completed  += (s, e) => Entry_First_Name.Focus();
            Entry_First_Name.Completed        += (s, e) => Entry_Last_Name.Focus();
            Entry_Last_Name.Completed         += (s, e) => GenderPicker.Focus();
            GenderPicker.SelectedIndexChanged += (s, e) =>
            {
                if (GenderPicker.SelectedIndex == -1)
                {
                    return;
                }
                else
                {
                    string profileTypeName = ProfileTypePicker.Items[ProfileTypePicker.SelectedIndex];
                    string profileTypeId   = ProfileTypes[profileTypeName];
                    if (profileTypeId.Equals("interpreter"))
                    {
                        Entry_Email.Focus();
                    }
                    else
                    {
                        NativeLanguagePicker.Focus();
                    }
                }
            };
            NativeLanguagePicker.SelectedIndexChanged += (s, e) => Entry_Email.Focus();
            Entry_Email.Completed        += (s, e) => Entry_Phone_Number.Focus();
            Entry_Phone_Number.Completed += (s, e) => Entry_Address.Focus();
            Entry_Address.Completed      += (s, e) => Entry_City.Focus();
            Entry_City.Completed         += (s, e) => Entry_Province.Focus();
            Entry_Province.Completed     += (s, e) => Entry_Zip_Code.Focus();

            foreach (String profileTypeName in ProfileTypes.Keys)
            {
                ProfileTypePicker.Items.Add(profileTypeName);
            }

            ProfileTypePicker.SelectedIndexChanged += (sender, args) =>
            {
                if (ProfileTypePicker.SelectedIndex == -1)
                {
                    return;
                }
                else
                {
                    string profileTypeName = ProfileTypePicker.Items[ProfileTypePicker.SelectedIndex];
                    string profileTypeId   = ProfileTypes[profileTypeName];
                    Lbl_Registration_Key.IsVisible   = profileTypeId.Equals("interpreter") ? true : false;
                    Entry_Registration_Key.IsVisible = profileTypeId.Equals("interpreter") ? true : false;
                    Lbl_NativeLanguage.IsVisible     = profileTypeId.Equals("client") ? true : false;
                    NativeLanguagePicker.IsVisible   = profileTypeId.Equals("client") ? true : false;
                }
            };
            foreach (String genderName in Genders.Keys)
            {
                GenderPicker.Items.Add(genderName);
            }

            Languages = new ObservableCollection <LanguageModel>();
            LoadLanguagesAsync();

            this.BindingContext = this;
        }