예제 #1
0
        public MainView(
            IThemeService themeService,
            IResourceService resourceService,
            IHostDialogService dialog)
        {
            AppSettings.OnInitialized();
            InitializeComponent();

            themeService.SetCurrentTheme(this);
            resourceService.UpdateResources(App.Current.Resources, themeService.GetCurrentName());

            HeaderBorder.MouseDown += (s, e) =>
            {
                if (e.ClickCount == 2)
                {
                    SetWindowState();
                }
            };
            HeaderBorder.MouseMove += (s, e) =>
            {
                if (e.LeftButton == System.Windows.Input.MouseButtonState.Pressed)
                {
                    this.DragMove();
                }
            };

            BtnMin.Click   += BtnMin_Click;
            BtnMax.Click   += BtnMax_Click;
            BtnClose.Click += BtnClose_Click;
            this.dialog     = dialog;
        }
예제 #2
0
        public SendTwoFactorCodeViewModel(IHostDialogService dialog,
                                          ProxyTokenAuthControllerService proxyTokenAuthControllerService,
                                          IAccountService accountService)
        {
            this.dialog = dialog;
            _proxyTokenAuthControllerService = proxyTokenAuthControllerService;
            _accountService         = accountService;
            _twoFactorAuthProviders = new List <string>();

            SendSecurityCodeCommand = new DelegateCommand(SendSecurityCodeAsync);
        }
예제 #3
0
        /// <summary>
        /// 询问窗口-指定标题
        /// </summary>
        /// <param name="hostDialogService"></param>
        /// <param name="title">标题</param>
        /// <param name="message">提示消息</param>
        /// <param name="IdentifierName">会话ID</param>
        /// <returns></returns>
        public static async Task <bool> Question(this IHostDialogService hostDialogService,
                                                 string title,
                                                 string message,
                                                 string IdentifierName = AppCommonConsts.RootIdentifier)
        {
            DialogParameters param = new DialogParameters();

            param.Add("Title", title);
            param.Add("Message", message);

            var dialogResult = await hostDialogService.ShowDialogAsync(AppViewManager.HostMessageBox, param, IdentifierName);

            return(dialogResult.Result == ButtonResult.OK);
        }
예제 #4
0
 public AccountService(
     IHostDialogService dialog,
     IApplicationContext applicationContext,
     ISessionAppService sessionAppService,
     IAccessTokenManager accessTokenManager,
     IAccountStorageService dataStorageService,
     AbpAuthenticateModel authenticateModel)
 {
     this.dialog             = dialog;
     this.applicationContext = applicationContext;
     this.sessionAppService  = sessionAppService;
     this.accessTokenManager = accessTokenManager;
     this.dataStorageService = dataStorageService;
     this.AuthenticateModel  = authenticateModel;
 }
        public DynamicEditValuesViewModel(
            IDynamicPropertyValueAppService appService,
            IApplicationContext context,
            IDataPagerService dataPager,
            IHostDialogService dialog)
        {
            this.appService = appService;
            this.context    = context;
            this.dataPager  = dataPager;
            this.dialog     = dialog;
            RefreshCommand  = new DelegateCommand(Refresh);
            ShowAddCommand  = new DelegateCommand(() => IsAdd = true);
            AddValueCommand = new DelegateCommand(AddValue);

            EditCommand   = new DelegateCommand <DynamicPropertyValueDto>(Edit);
            DeleteCommand = new DelegateCommand <DynamicPropertyValueDto>(Delete);
        }
예제 #6
0
        internal static async Task <IDialogResult> ShowDialog(
            IHostDialogService dialogHostService,
            MessageType messageType,
            string message
            , string IdentifierName = "")
        {
            if (string.IsNullOrWhiteSpace(IdentifierName))
            {
                IdentifierName = default_IdentifierName;
            }

            DialogParameters param = new DialogParameters();

            param.Add("Type", messageType);
            param.Add("Message", message);

            return(await dialogHostService.ShowDialogAsync("MessageView", param, IdentifierName));
        }
예제 #7
0
        public DynamicEntityDetailsViewModel(
            IDynamicPropertyAppService propertyAppService,
            IDynamicEntityPropertyAppService appService,
            IApplicationContext context,
            IDataPagerService dataPager,
            IHostDialogService dialog)
        {
            this.dialog             = dialog;
            this.context            = context;
            this.dataPager          = dataPager;
            this.appService         = appService;
            this.propertyAppService = propertyAppService;

            items = new ObservableCollection <DynamicPropertyDto>();

            RefreshCommand  = new DelegateCommand(Refresh);
            ShowAddCommand  = new DelegateCommand(ShowAdd);
            AddValueCommand = new DelegateCommand(AddValue);
            DeleteCommand   = new DelegateCommand <DynamicEntityPropertyDto>(Delete);
        }
예제 #8
0
 public static async Task <IDialogResult> Question(this IHostDialogService dialogHostService, string message, string IdentifierName = "")
 {
     return(await ShowDialog(dialogHostService, MessageType.Question, message));
 }
예제 #9
0
 public static void Error(this IHostDialogService dialogHostService, string message, string IdentifierName = "")
 {
     _ = ShowDialog(dialogHostService, MessageType.Error, message, IdentifierName);
 }
예제 #10
0
 /// <summary>
 /// 询问窗口
 /// </summary>
 /// <param name="hostDialogService"></param>
 /// <param name="message">提示消息</param>
 /// <param name="IdentifierName">会话ID</param>
 /// <returns></returns>
 public static async Task <bool> Question(this IHostDialogService hostDialogService,
                                          string message,
                                          string IdentifierName = AppCommonConsts.RootIdentifier)
 {
     return(await Question(hostDialogService, Local.Localize("AreYouSure"), message, IdentifierName));
 }