Exemplo n.º 1
0
        public OkCancelDialogBoxResult ShowOkCancelDialogBox(IOkCancelDialogBoxViewModel dialogViewModel)
        {
            var result = OkCancelDialogBoxResult.None;

            var dialogCommands = new DialogBoxCommands(dialogViewModel);
            var window         = _windowsFactory.CreateModalWindow();


            dialogCommands.OkCommand = new Command(() =>
            {
                result = ExecuteOkDialog(dialogViewModel, window);
            });

            dialogCommands.CancelCommand = new Command(() =>
            {
                result = ExecuteCancelDialog(dialogViewModel, window);
            });


            window.Commands = dialogCommands;


            _applicationServices.ExecuteOnUIThread(() => window.ShowModal());

            return(result);
        }
Exemplo n.º 2
0
        private void ValidateAsync()
        {
            while (true)
            {
                var errors = new List <ErrorMessageViewModel>();

                errors.AddRange(ValidateApprovedGames());
                errors.AddRange(ValidateAlsoPlayingGames());
                errors.AddRange(ValidateLobby());
                errors.AddRange(ValidateTopGames(_skinDesigner.SkinDefinition.TopGames));
                errors.AddRange(ValidateTopGames(_skinDesigner.SkinDefinition.VipGames));
                errors.AddRange(ValidateFilters());

                errors = errors.OrderByDescending(err => err.Severity).ThenBy(err => err.SourceName).ToList();

                var errorList = new ErrorListViewModel(errors);

                _applicationServices.ExecuteOnUIThread(() =>
                {
                    _skinDesigner.ErrorList = errorList;
                }
                                                       );

                _autoResetEvent.WaitOne();
            }
        }
Exemplo n.º 3
0
        public void UnregisterOperation(IBackgroundOperation operation)
        {
            var operationViewModel = this.Operations.FirstOrDefault(op => op.Contains(operation));

            if (operationViewModel != null)
            {
                ApplicationServices.ExecuteOnUIThread(() => this.Operations.Remove(operationViewModel));
            }
        }
Exemplo n.º 4
0
 protected void ExecuteOnUIThread(Action action)
 {
     _appServices.ExecuteOnUIThread(action);
 }