コード例 #1
0
        protected virtual void MainMenuAction(object obj)
        {
            var nv = obj as INavigationInfo;

            if (nv == null || nv.NavigationParameters.Count <= 0)
            {
                return;
            }

            try
            {
                //Validate Roles
                //if (AuthenticationService != null && !AuthenticationService.IsValid(nv.PermissionValidation))
                //{
                //    MessageBoxService.Alert(this, "You are not authorized to access this action.");
                //    return;
                //}
                nv.NavigationParameters.ForEach(ExecuteNavigation);
            }
            catch (Exception ex)
            {
                Logger.Exception(ex);
                MessageBoxService.Alert(this, ex.Message);
            }
        }
コード例 #2
0
 /// <summary>
 ///     User this as Default NavigationCallback. Override this for custom handle logic.
 /// </summary>
 /// <param name="result"></param>
 protected virtual void DefaultNavigationCallback(NavigationResult result)
 {
     if (result.Error == null)
     {
         return;
     }
     Logger.Exception(result.Error);
     MessageBoxService?.Alert(this, result.Error.Message);
 }
コード例 #3
0
 private void OnSave(object parameters)
 {
     try
     {
         ShellConfigManager.SaveChanges(SelectedModule);
         MessageBoxService.Info(this, $"The changes of Module {SelectedModule.Name} had been saved.");
         StatusService.SetStatus($"Saved the changes of {SelectedModule?.Name}");
     }
     catch (Exception ex)
     {
         Logger.Exception(ex);
         MessageBoxService.Alert(this, ex.Message);
     }
 }
コード例 #4
0
 private void NotifyClicked()
 {
     MessageBoxService.Info(this, "This is a Information box.", "Information",
                            rs1 => MessageBoxService.Alert(this, "This is a Alert box.", "Alert",
                                                           rs2 => MessageBoxService.Confirm(this, "this is Confirmation box.")));
 }