Skip to content

6.2.8.5. ConfirmationVM

6.2.8.5.1. When To Use It

Use ConfirmationVM when the notification should stay visible until the user explicitly approves, rejects, or dismisses it. It is the render-side sibling of NotificationVM for decision-bearing prompts.

6.2.8.5.2. Shape And Ownership

ConfirmationVM extends the notification render contract with:

  • ApproveCommand
  • RejectCommand
  • longer default lifespan (300 s)
  • no auto-resolve on timer expiry

Like NotificationVM, it still resolves through INotificationHub.

6.2.8.5.3. Lifecycle And Messaging

The key difference from NotificationVM is timeout behavior:

  • the timer may drive UI decay, but not resolution
  • timeout means "user did not decide yet"
  • explicit approve/reject flows resolve the underlying notification
  • inherited dismiss still resolves with Approve

Approve/reject commands and inherited rendering resources are released at most once; first resolution still wins. See the Disposal Contract.

6.2.8.5.4. Cross-Language Surface

Concept C# Python TypeScript Swift
Type ConfirmationVM ConfirmationVM ConfirmationVM ConfirmationVM
Default lifespan 300 s 300 s 300 s 300 s
Reject command RejectCommand reject_command rejectCommand rejectCommand

6.2.8.5.5. Example

The flagship Notes Workspace apps currently do not project confirmations through ConfirmationVM. They use command-level confirmation gates plus host dialogs:

  • command gating in the note delete flow via ConfirmationDecoratorCommand
  • host prompts via IDialogService.Confirm

That split is intentional. Use ConfirmationVM when the confirmation itself should be part of a rendered notification stream rather than a host modal.

When you do want the confirmation inside the notification stream, the direct library surface is:

using var vm = new ConfirmationVM(notification, hub, scheduler);
vm.RejectCommand.Execute(null);
vm = ConfirmationVM(notification=notif, hub=hub, scheduler=scheduler)
vm.reject_command.execute()
const vm = new ConfirmationVM(notif, hub, scheduler);
vm.rejectCommand.execute();
let vm = ConfirmationVM(notification: notif, hub: hub, scheduler: scheduler)
vm.rejectCommand.execute()

6.2.8.5.6. Common Pitfalls

  • Expecting timeout to auto-resolve. It does not.
  • Using ConfirmationVM when the host already provides the correct blocking confirmation via IDialogService.
  • Forgetting that inherited dismiss resolves with approve semantics.