...where you can belong to a school club, a gaming group, or a worldwide art community. Where just you and a handful of friends can spend time together. A place that makes it easy to talk every day and hang out more often.
昨年の年末、コミックマーケットC85で出した Far East Developer Review - DevLOVE Pub the booth に寄稿した「MVVMで始めるWindowsストアアプリ」の続きになります。 (「MVVMで始めるWindowsストアアプリ」の記事が読めるFar East Developer Review - DevLOVE Pub the boothは DevLOVE Pub the boothにて頒布しています。) Messengerパターンを扱う Messengerパターンは、ViewModelからViewに要求を送る場合にとるパターン(のよう)です。 Messageを詰めるオブジェクト(Messageオブジェクト)を用意し、ViewModelにてMessageオブジェクトを送ると、Messageオブジェクトを受け取るように定義したViewにて、Messa
はじめに 以前、MVVM パターンで ViewModel から View を操作する話題で祭になりました。 MVVM パターンで VM から VIEW を操作したい MVVMでVMからViewを操作する考察 - The Road to C# Master Trapemiya MVVMパターンでVMからVに通知する方法 - かずきのBlog@Hatena MVVM パターンで ViewModel から Viewを操作する方法 - present その後しばらく WPF や Silverlight から離れていたんですが、その間に Messenger というパターンが有力になってきたみたいです。さっそく調査開始。 Messenger パターンって? 簡単に説明すると、View と ViewModel が共通の Messenger を参照し、ViewModel は Messenger を介して
Motto: "Talk is cheap, show me the code!" This blog attempts to be a collection of how-to examples in the Microsoft software stack - things that may take forever to find out, especially for the beginner. I see it as my way to return something to the Microsoft community in exchange for what I learned from it. The very first Silverlight application I had to make professionally (i.e. not as a hobby/r
public final class Messenger { private Map<String, Action1<? extends Message>> _actions = new HashMap<String, Action1<? extends Message>>(); public <T extends Message> void register(Action1<T> action) { // action が使ってる Generics な型を取り出す(という意味?)。 // action.getClass().getInterfaces(); でもいけるかと思ったら、Action1 までしか取り出せなかった。 Type[] types = action.getClass().getGenericInterfaces(); // 文字列化したら Action1<T> の T
図 5 に示すように、リスクがある場合でも、登録解除の失敗により必ずしもメモリ リークが発生するわけではないことに注意してください。つまり、メモリ リークを発生しないようにするには、受信側を必要としなくなったら、Messenger から受信側の登録解除を明示的に行うようにします。この処理は、Unregister メソッドを使用して実行できます。Unregister メソッドには複数のオーバーロードがあります。受信側は Messenger から完全に登録解除できます。また、特定の 1 つのメソッドのみ登録解除して、他のメソッドはアクティブな状態を保持することもできます。 Messenger 使用時のその他のリスク 前述のとおり、MVVM Light Messenger は非常に強力で汎用性の高いコンポーネントですが、使用時にはいくつかリスクも伴います。Silverlight や Window
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く