■ [c#] WPFでICommandとINotifyPropertyChangedを使う WPFではボタンやメニューをクリックしたときにICommandを実装したクラス(コマンド)のメソッドを呼び出す仕組みがある。また、INotifyPropertyChangedを実装することでViewModelの状態変化をViewへ通知することができる。これらの機能を使った次のプログラムを作ってみた。 追加ボタンをクリックするとテキストボックスの内容を画面下部に追加する。このときテキストボックスの内容はクリアする。 テキストボックスが空だとボタンはクリックできない。 MainWindow.xaml <Window x:Class="Hello.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xm
![WPFでICommandとINotifyPropertyChangedを使う - メモの日々(2017-06-12)](https://cdn-ak-scissors.b.st-hatena.com/image/square/b7e2b2a529bc9188ae2599bdf5357e96cec7472e/height=288;version=1;width=512/http%3A%2F%2Fogawa.s18.xrea.com%2Ftdiary%2Ftheme%2Fogimage.png)