mirror of
https://github.com/soukoku/ntwain.git
synced 2025-09-19 01:57:56 +08:00
Added error handling to wpf example.
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user