バインディングをキャッチして複数のプロパティに複製できるようにするために、BindingExpressionタイプのSelectorにアタッチされたプロパティを定義しました。アタッチされたプロパティは、セレクターがXAMLで直接定義されている場合に正常に機能します。ただし、SelectorがDataTemplate内で定義されている場合、プロパティ変更ハンドラーは起動されません。
付属物件
public static readonly DependencyProperty EnumBindingProperty = DependencyProperty.RegisterAttached(
"EnumBinding", typeof(BindingExpression), typeof(SelectorHelper),
new PropertyMetadata(null, OnEnumBindingChanged));
使用法(有効)
<ComboBox AttachedProperties:SelectorHelper.EnumBinding="{Binding Phase}" />
使用法(無効)
<DataTemplate>
<ComboBox AttachedProperties:SelectorHelper.EnumBinding="{Binding Phase}" />
</DataTemplate>
Snoopを使用してプロパティを評価すると、プロパティが自動的に更新されて機能し始めることがわかったため、タイミングの問題のようです。
ヘルプや説明をいただければ幸いです。:)