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); }
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(); } }
public void UnregisterOperation(IBackgroundOperation operation) { var operationViewModel = this.Operations.FirstOrDefault(op => op.Contains(operation)); if (operationViewModel != null) { ApplicationServices.ExecuteOnUIThread(() => this.Operations.Remove(operationViewModel)); } }
protected void ExecuteOnUIThread(Action action) { _appServices.ExecuteOnUIThread(action); }