예제 #1
0
        private void EditEmailPopup(object o, EventArgs e)
        {
            ChangeEmailPopup newPopup = new ChangeEmailPopup();

            newPopup.BindingContext = this.vm;
            PopupNavigation.Instance.PushAsync(newPopup);
        }
예제 #2
0
        public ProfilePage(User user)
        {
            InitializeComponent();
            _user          = user;
            BindingContext = viewModel = new ProfilePageViewModel(_user);
            ChangePhonePopup.Body.BindingContext = viewModel;
            Init();

            ChangePasswordPopup.BackgroundColor = Color.FromRgba(0, 0, 0, 0.3);
            ChangeEmailPopup.BackgroundColor    = Color.FromRgba(0, 0, 0, 0.3);
            ChangePhonePopup.BackgroundColor    = Color.FromRgba(0, 0, 0, 0.3);
            OtpPopup.BackgroundColor            = Color.FromRgba(0, 0, 0, 0.3);

            MessagingCenter.Subscribe <ProfilePageViewModel, bool>(this, "OtpPopup", async(sender, arg) =>
            {
                OtpPopup.IsVisible = arg;
                entryOTP1.Focus();
                progressBar.Progress = 1;
                spReset.TextColor    = Color.Gray;
                Device.StartTimer(TimeSpan.FromMilliseconds(updateRate), () =>
                {
                    if (progressBar.Progress > 0)
                    {
                        Device.BeginInvokeOnMainThread(() => progressBar.Progress -= step);
                        return(true);
                    }
                    lblResetOtp.IsEnabled = true;
                    spReset.TextColor     = Color.FromHex("0089D1");
                    return(false);
                });
            });

            MessagingCenter.Subscribe <ProfilePageViewModel, User>(this, "UpdateProfile", async(sender, arg) =>
            {
                viewModel.User = arg;
                image.Source   = arg.AvatarFullUrl;
            });

            MessagingCenter.Subscribe <ProfilePageViewModel, bool>(this, "ClosePopup", async(sender, arg) =>
            {
                ChangePasswordPopup.IsVisible = ChangePhonePopup.IsVisible = ChangeEmailPopup.IsVisible = arg;
            });

            ChangePasswordPopup.CustomCloseButton(OnCloseChangePassword);
            ChangeEmailPopup.CustomCloseButton(OnCloseChangeEmail);
            ChangePhonePopup.CustomCloseButton(OnCloseChangePhone);
        }
예제 #3
0
        private async void OnCloseChangeEmail(object sender, EventArgs e)
        {
            await ChangeEmailPopup.Hide();

            entryEmail.Text = null;
        }
예제 #4
0
 //edit email
 private async void OnEditEmailClicked(object sender, EventArgs e)
 {
     await ChangeEmailPopup.Show();
 }