2014-11-15から1日間の記事一覧
ボタンをバインディングしているブール値で画像を切り替えたいとする。 <UserControl.Resources> <local:ButtonConverter x:Key="bConverter"/> </UserControl.Resources> <Button Foreground="{Binding flag, Converter={StaticResource bConverter}}" /> のように、Conveterを通じて変換することになる。Converterの定義は以下のようにする。 class ButtonConverter : IValueConverter { obj…</button>