示例#1
0
 private void OnSave(object sender)
 {
     NewPasswordBox.Password = NewPasswordBox.Password + "1";
     NewPasswordBox.Password = NewPasswordBox.Password.Substring(0, NewPasswordBox.Password.Length - 1);
     ConfirmPasswordBox.Password = ConfirmPasswordBox.Password + "1";
     ConfirmPasswordBox.Password = ConfirmPasswordBox.Password.Substring(0, ConfirmPasswordBox.Password.Length - 1);
     if (this.PasswordClass.NewPassword == string.Empty)
     {
         this.NewPasswordBox.Focus();
         return;
     }
     else if (this.PasswordClass.NewPassword != this.PasswordClass.ConfirmPassword)
     {
         this.ConfirmPasswordBox.Focus();
         return;
     }
     this.CurrentUser.Password = this.PasswordClass.NewPassword;
     this._service.SubmitChanges(UniCloud.Infrastructure.CAFMStrings.SaveSuccess, UniCloud.Infrastructure.CAFMStrings.SaveFail, sm => {
         if (sm.Error == null)
         {
             var navigation = new MessageOperationLibrary.Events.NavigationEvent();
             MessageEventAggregatorRepository.EventAggregator.Publish<MessageOperationLibrary.Events.NavigationEvent>(navigation);
         }
     }, null);
 }
        public void ConfirmNavigationRequest(NavigationContext navigationContext, Action<bool> continuationCallback)
        {
            if (this._canSave == true)
            {
                this.confirmExitInteractionRequest.Raise(
                     new ConfirmViewModel { ConfirmContent = CAFMStrings.ConfirmNavigateAwayFromRequestDetail, ConfirmTitle = CAFMStrings.ConfirmNavigateAwayFromRequestDetailTitle },
                     c =>
                     {
                         if (c.Result)
                         {
                             this._service.RejectChanges();
                             this.isChanged = false;
                             continuationCallback(true);
                         }
                         else
                         {
                             continuationCallback(false);
                             var navigation = new MessageOperationLibrary.Events.NavigationEvent(false);
                             MessageEventAggregatorRepository.EventAggregator.Publish<MessageOperationLibrary.Events.NavigationEvent>(navigation);
                         }
                     });

            }
            else
                continuationCallback(true);
        }
示例#3
0
 private void OnAbort(object sender)
 {
     var navigation = new MessageOperationLibrary.Events.NavigationEvent();
     MessageEventAggregatorRepository.EventAggregator.Publish<MessageOperationLibrary.Events.NavigationEvent>(navigation);
 }