/// <summary> /// Removes the after status information after the specified duration. /// </summary> /// <param name="duration">The duration.</param> /// <returns> /// A task that represents the asynchronous operation. The result of the task indicates /// whether the screen was deactivated/closed successfully. /// </returns> public async Task <bool> CloseAfterAsync(TimeSpan duration) { CheckAccess(); await Task.Delay(duration); return(await Conductor.DeactivateItemAsync(this, true)); }
/// <inheritdoc/> public void Exit(int exitCode = (int)Editor.ExitCode.ERROR_SUCCESS) { if (!_exitCode.HasValue) { _exitCode = exitCode; } // Exit can be called by command line parsing. In this case we are not yet conducted. Conductor?.DeactivateItemAsync(this, true); }
//-------------------------------------------------------------- #region Creation & Cleanup //-------------------------------------------------------------- /// <summary> /// Initializes a new instance of the <see cref="AboutViewModel"/> class. /// </summary> /// <param name="aboutService">The <see cref="IAboutService"/>.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="aboutService"/> is <see langword="null"/>. /// </exception> public AboutViewModel(IAboutService aboutService) { if (aboutService == null) { throw new ArgumentNullException(nameof(aboutService)); } AboutService = aboutService; DisplayName = Invariant($"About {AboutService.ApplicationName}"); CloseAboutDialogCommand = new DelegateCommand(() => Conductor.DeactivateItemAsync(this, true)); CopyToClipboardCommand = new DelegateCommand(() => AboutService.CopyInformationToClipboard()); }
private void Close() { // Close this screen. Do not await because we are in the Close event handler. Conductor.DeactivateItemAsync(this, true); }
/// <summary> /// Removes the status information immediately. /// </summary> /// <returns> /// A task that represents the asynchronous operation. The result of the task indicates /// whether the screen was deactivated/closed successfully. /// </returns> public Task <bool> CloseAsync() { return(Conductor.DeactivateItemAsync(this, true)); }
private void Cancel() { Logger.Debug("Closing Options dialog. (\"Cancel\" selected.)"); Conductor.DeactivateItemAsync(this, true).Forget(); }
private void Ok() { Logger.Debug("Applying changes and closing Options dialog. (\"OK\" selected.)"); ApplyChanges(); Conductor.DeactivateItemAsync(this, true).Forget(); }