私は以下のようないくつかのコントロールを持つビューを持っています:
<c:DropTargetContentControl Content="{Binding FavoriteTool1, Mode=TwoWay}" ContentTemplate="{StaticResource FavoriteTemplate}" Margin="5,0"/>
<c:DropTargetContentControl Content="{Binding FavoriteTool2, Mode=TwoWay}" ContentTemplate="{StaticResource FavoriteTemplate}" Margin="5,0"/>
<c:DropTargetContentControl Content="{Binding FavoriteTool3, Mode=TwoWay}" ContentTemplate="{StaticResource FavoriteTemplate}" Margin="5,0"/>
FavouriteTool1, FavouriteTool2, FavouriteTool3
ビューモデルのプロパティです。
これらのプロパティPropertyChanged
は、 に変更があったときにイベントを発生させDropTargetContentControl
ます。またPropertyChanged
、ViewModel から何らかの値を設定すると、これらが発生します。PropertyChanged
の変更により が発生した場合にのみ、いくつかの関数を呼び出す必要がありますDropTargetContentControl
。
propertychanged イベントを追跡するにはどうすればよいですか? ビューレベルで何かを変更する柔軟性がありません。