Skip to content

WPF MessageBox with Styles and Invokable from ViewModel

Notifications You must be signed in to change notification settings

pierre01/MessageBox

Repository files navigation

MVVM MessageBox Service for WPF (using Dependency Injection)

A C# MVVM Service for displaying simple MessageBox messages with custom styles included - Uses MVVM Toolkit with Microsoft.Extensions.DependencyInjection but can be adapted to any MVVM / DI Library. This service illustrate how you can have a view model that displays dialog boxes but still can be easily unit tested.

In the example the MainViewModel is unit tested at 100% code coverage even with a complex path that display mutiple dialogs with various choices.

Include samples and an Example to unit test code involving a complex path with multiple MessageBoxes

image

image

image

image

This shows a function including multiple decisions triggered by user input. The Unit test module shows how to unit test the function for full code coverage.

Complex Path

About

WPF MessageBox with Styles and Invokable from ViewModel

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages