Beispiel #1
0
        public MnemonicPhraseViewModel(Page context, CommonPageSettings pageSettings)
        {
            this.HeaderText     = pageSettings.HeaderText;
            this.IsCustomHeader = pageSettings.IsShowCustomHeader;

            _context = context;
        }
Beispiel #2
0
        private async void OpenPageLoginClick(object sender, EventArgs e)
        {
            var succesHandler = new EventHandler <PinEventArgs>((pinSender, pinEventArgs) =>
            {
                App.SetMainPage(new BottomTabbedPage());

                Settings.Set(Settings.Key.IsLogged, true);
            });

            var setting = new CommonPageSettings
            {
                Title         = "Unlock Wallet",
                HeaderText    = "Enter your 4 digit pin",
                HasNavigation = true,
                HasBack       = true
            };

            await Navigation.PushSingleAsync(
                new PinAuthPage(
                    succesHandler,
                    valid => Equals(valid, Settings.Get(Settings.Key.Pin)),
                    "The 4 Digit pin you entered is incorrect.\nPlease review your pin and try again.",
                    setting,
                    true));
        }
Beispiel #3
0
        public PinAuthViewModel(Page context, CommonPageSettings pageSettings, bool isReset)
        {
            _context               = context;
            _pinViewModel          = new PinViewModel();
            this.IsCustomHeader    = pageSettings.IsShowCustomHeader;
            _pinViewModel.Error   += (object sender, EventArgs e) => { IsInvalid = true; };
            _pinViewModel.Success += (object sender, PinEventArgs e) => { IsInvalid = false; };

            IsReset = isReset;
        }
        public InputMnemonicViewModel(Page context, CommonPageSettings pageSettings)
        {
            this.HeaderText     = pageSettings.HeaderText;
            this.IsCustomHeader = pageSettings.IsShowCustomHeader;
            this.Text           = pageSettings.Text;
            this.LeftButtonText = pageSettings.LeftButtonText;

            this._context = context;
            IsInvalid     = false;
            Validators    = new List <KeyValuePair <string, Func <string, bool> > >();
        }
Beispiel #5
0
        public SuccessSignup(CommonPageSettings pageSettings, Action nextAction)
        {
            InitializeComponent();

            // init top bar
            NavigationPage.SetHasNavigationBar(this, pageSettings.HasNavigation);
            NavigationPage.SetHasBackButton(this, pageSettings.HasBack);
            this.Title = pageSettings.Title;

            this.nextAction = nextAction;

            Message.Text = pageSettings.HeaderText;
        }
        public InputMnemonicPhrasePage(CommonPageSettings pageSettings)
        {
            InitializeComponent();

            // init top bar
            NavigationPage.SetHasNavigationBar(this, pageSettings.HasNavigation);
            NavigationPage.SetHasBackButton(this, pageSettings.HasBack);
            this.Title = pageSettings.Title;

            ViewModel = new InputMnemonicViewModel(this, pageSettings);

            BindingContext = ViewModel;
        }
Beispiel #7
0
        public MnemonicPhrasePage(CommonPageSettings pageSettings)
        {
            InitializeComponent();

            // init top bar
            NavigationPage.SetHasNavigationBar(this, pageSettings.HasNavigation);
            NavigationPage.SetHasBackButton(this, pageSettings.HasBack);
            this.Title = pageSettings.Title;

            // init words table
            FlowListView.Init();

            viewModel      = new MnemonicPhraseViewModel(this, pageSettings);
            BindingContext = viewModel;
        }
Beispiel #8
0
        public App()
        {
            InitializeComponent();

            Page startPage;

            if (Equals(Settings.Get(Settings.Key.IsLogged), true) && Equals(Settings.Get(Settings.Key.IsLockApp), true))
            {
                var setting = new CommonPageSettings
                {
                    HeaderText    = "Enter your 4 digit pin",
                    HasNavigation = false
                };

                var page = new BottomTabbedPage();

                startPage = new PinAuthPage(
                    (sender, args) =>
                {
                    SetMainPage(page);
                },
                    valid => Equals(valid, Settings.Get(Settings.Key.Pin)),
                    "The 4 Digit pin you entered is incorrect.\nPlease review your pin and try again.",
                    setting,
                    true);
            }
            else if (Equals(Settings.Get(Settings.Key.IsLogged), true))
            {
                startPage = new BottomTabbedPage();
            }
            else if (Equals(Settings.Get(Settings.Key.ResumePage), true))
            {
                startPage = new CreateWalletPage();
            }
            else if (!Equals(Settings.Get(Settings.Key.PinSetupPage), true))
            {
                startPage = new PinAuthPage(
                    async(sender1, args) =>
                {
                    var pin     = args.EnteredPin;
                    var setting = new CommonPageSettings
                    {
                        HasNavigation = true,
                        Title         = "Confirm Pin",
                        HeaderText    = "Create your 4 digit pin",
                        HasBack       = true
                    };

                    await MainPage.Navigation.PushAsync(
                        new PinAuthPage(
                            (sender2, args2) =>
                    {
                        Settings.Set(Settings.Key.Pin, pin);
                        Settings.Set(Settings.Key.PinSetupPage, true);

                        Settings.Set(Settings.Key.IsLockApp, false);
                        Settings.Set(Settings.Key.IsNotification, true);

                        SetMainPage(new GuapPage());
                    },
                            c => Equals(c, pin),
                            "The 4 Digit pin you entered is incorrect.\nPlease review your pin and try again.",
                            setting));
                },
                    c => true,
                    string.Empty,
                    new CommonPageSettings
                {
                    HasNavigation = false,
                    HeaderText    = "Create your 4 digit pin"
                });
            }
            else
            {
                startPage = new GuapPage();
            }

            SetMainPage(startPage);
        }
Beispiel #9
0
        public PinAuthPage(EventHandler <PinEventArgs> successHandler, Func <string, bool> validatorFunc, string errorMessage, CommonPageSettings pageSettings, bool isReset = false)
        {
            this.Title = pageSettings.Title;

            NavigationPage.SetHasNavigationBar(this, pageSettings.HasNavigation);
            NavigationPage.SetHasBackButton(this, pageSettings.HasBack);
            InitializeComponent();

            viewModel = new PinAuthViewModel(this, pageSettings, isReset);

            viewModel.PinViewModel.Success       += successHandler;
            viewModel.PinViewModel.ValidatorFunc += validatorFunc;
            viewModel.Error     = errorMessage;
            viewModel.Header    = pageSettings.HeaderText;
            base.BindingContext = viewModel;
        }