Relativity
Relativity

Reputation: 6868

WPF : customised Messge box to use in MVVM

I know that we can't use messageBox in xaml. But..Can we have a custome "Message box user control"...with a view model..which is having following properties : Message, Trigger (to popup), Icon ???

Upvotes: 0

Views: 1438

Answers (1)

blindmeis
blindmeis

Reputation: 22435

sure you can do this. just create a window(maybe a viewmodel too if needed) with stuff and properties you want your messagebox look like. then create a ICustomMessageBoxService interface and implementation which you can use in your viewmodels to show your CustomMessageBox.

look here. there is an example for a custom dialog service. you can easily customize it for your messageboxservice.

Upvotes: 1

Related Questions