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
を入れたいと思います。name
LabelToDisplay