Skip to content

Instantly share code, notes, and snippets.

@rtanote
Created June 10, 2013 03:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rtanote/5746286 to your computer and use it in GitHub Desktop.
Save rtanote/5746286 to your computer and use it in GitHub Desktop.
Livetを使ったエラーメッセージ等の実装例
/*
<!-- xmlns:l="http://schemas.livet-mvvm.net/2011/wpf" -->
<i:Interaction.Triggers>
<l:InteractionMessageTrigger MessageKey="Error" Messenger="{Binding Messenger}">
<l:InformationDialogInteractionMessageAction/>
</l:InteractionMessageTrigger>
</i:Interaction.Triggers>
*/
// ViewModel
try {
// do something.
} catch (Exception e) {
Messenger.Raise(new InformationMessage("例外が発生しました","エラー","Error"));
//MessageBox.Show("例外が発生しました");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment