public override void Open()
 {
     base.Open();
     inputField.onValidateInput += Validate;
     inputField.onValueChanged.AddListener(SetContinueButton);
     inputField.SetTextWithoutNotify("");
     propertyHandler = new PropertyChangeHandler <ImportAccount>(ContextControler)
     {
         { nameof(ImportAccount.Hint), x => hint.SetText(x.Hint) },
         { nameof(ImportAccount.ActionDescription), x => buttonInfo.SetText(x.ActionDescription) },
         { nameof(ImportProcedure.WaitingForUserProceed), x =>
           {
               var waitingForUser = ContextControler.Procedure.WaitingForUserProceed;
               var oldInteract    = !continueButton.interactable && waitingForUser;
               continueButton.interactable = ContextControler.Procedure.WaitingForUserProceed;
               if (oldInteract)
               {
                   continueButton.Select();
               }
               if (!waitingForUser)
               {
                   backButton.Select();
               }
           } },
         { nameof(ImportAccount.InputPINVisiable),
           x =>
           {
               inputField.gameObject.SetActive(ContextControler.InputPINVisiable);
               if (ContextControler.InputPINVisiable)
               {
                   continueButton.interactable = false;
                   SelectWhenAvailabe(inputField);
               }
           } },
         { nameof(ImportAccount.InputPINInteractive),
           x =>
           {
               inputField.interactable = ContextControler.InputPINInteractive;
               if (ContextControler.InputPINInteractive)
               {
                   SelectWhenAvailabe(inputField);
               }
           } },
         { nameof(ImportAccount.ConfimationPIN), x =>
           {
               if (string.IsNullOrEmpty(x.ConfimationPIN))
               {
                   exportPin.gameObject.SetActive(false);
               }
               else
               {
                   exportPin.gameObject.SetActive(true);
                   exportPin.text = x.ConfimationPIN;
               }
           } },
     };
     propertyHandler.Setup();
 }
        override public void Open()
        {
            base.Open();

            profileDisplay = profileDisplay ?? (profileBar as IObserver <Profile>);

            changeHandler = new PropertyChangeHandler <CurrentUser>(ContextControler)
            {
                { nameof(ContextControler.Profile), (x) => profileDisplay.OnNext(x.Profile) },
            };
            changeHandler.Setup();
        }
示例#3
0
 void Source_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     try
     {
         WaitStart();
         var field = Fields.FirstOrDefault(i => i.Name.EqIgnoreCase(e.PropertyName));
         if (field != null)
         {
             if (PropertyChangeHandler != null && field.IsOnPropertyChange)
             {
                 PropertyChangeHandler.OnPropertyChange(this, e.PropertyName);
             }
         }
     }
     finally
     {
         WaitStop();
     }
 }
        public override void Open()
        {
            base.Open();
            inputField.SetTextWithoutNotify("");
            propertyHandler = new PropertyChangeHandler <ExportAccount>(ContextControler)
            {
                { nameof(ExportAccount.Hint), x => hint.SetText(x.Hint) },
                { nameof(ExportAccount.ActionDescription), x => buttonInfo.SetText(x.ActionDescription) },
                { nameof(ExportProcedure.WaitingForUserProceed), x =>
                  {
                      var oldInteract = !continueButton.interactable && ContextControler.Procedure.WaitingForUserProceed;
                      continueButton.interactable = ContextControler.Procedure.WaitingForUserProceed;
                      if (oldInteract)
                      {
                          continueButton.Select();
                      }

                      if (!ContextControler.Procedure.WaitingForUserProceed)
                      {
                          backButton.Select();
                      }
                  } },
                { nameof(ExportAccount.InputPIN), x => inputField.gameObject.SetActive(ContextControler.InputPIN) },
                { nameof(ExportAccount.ExportPIN), x =>
                  {
                      if (string.IsNullOrEmpty(x.ExportPIN))
                      {
                          exportPin.gameObject.SetActive(false);
                      }
                      else
                      {
                          exportPin.gameObject.SetActive(true);
                          exportPin.text = x.ExportPIN;
                      }
                  } },
            };
            propertyHandler.Setup();
        }