targetnameスタイル セッターの を依存関係プロパティのプロパティに設定しようとしていNameます。これにアプローチする方法がよくわかりません。
//Customcontrol's Generic.xaml <Style TargetType="{x:Type Controls:MyControl}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Controls:MyControl}"> <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"> <ContentControl Content="{TemplateBinding Content}"/> </Border> </ControlTemplate> </Setter.Value> </Setter> <Setter TargetName="WHAT SHOULD I PUT HERE" Property="Opacity" Value="0.75"/> </Style> // Dependency Property public static readonly DependencyProperty LabelToDisplayProperty ... // In XAML that adds the custom control LabelToDisplay="{x:Reference Name=TitleLabel}"
基本的にはプロパティが参照するオブジェクトのTargetNameを入れたいと思います。nameLabelToDisplay