Added error handling to wpf example.

This commit is contained in:
soukoku
2014-04-12 11:22:05 -04:00
parent 78d0a94bd2
commit dc41cebc18
5 changed files with 58 additions and 2 deletions

View File

@@ -20,6 +20,8 @@ using CommonWin32;
using System.Threading;
using ModernWPF.Controls;
using System.Reflection;
using System.ComponentModel;
using GalaSoft.MvvmLight.Messaging;
namespace Tester.WPF
{
@@ -44,6 +46,13 @@ namespace Tester.WPF
_twainVM = new TwainVM();
this.DataContext = _twainVM;
if (!DesignerProperties.GetIsInDesignMode(this))
{
Messenger.Default.Register<DialogMessage>(this, msg =>
{
ModernMessageBox.Show(this, msg.Content, msg.Caption, msg.Button, msg.Icon, msg.DefaultResult);
});
}
}
protected override void OnClosed(EventArgs e)