I need to describe the triggers to change the appearance of my UserControl . I wrote the <Style TargetType="{x:Type Controls:PropertyField}"> style inside <UserControl.Style> . The problem is that, for example, the trigger

 <Trigger Property="Error" Value=""> <Setter TargetName="Asterisk" Property="Visibility" Value="Collapsed"/> </Trigger> 

does not recognize the name Asterisk , although I have an element with that name defined inside the control.

  • You are trying to stylize UserControl, this is incorrect, it is not intended for this. If you need styling, you probably need custom control. - VladD
  • Then we come back to this question: ru.stackoverflow.com/questions/891623/… - Puro
  • The point is this: there is an element within which there are buttons and input fields. Depending on the state of the element, these buttons and input fields should appear / disappear. By the state of an element, I also mean the "innate" properties of type isEnabled . Also, somewhere, the logic of user interaction with these elements must be processed. At first I had CustomControl , but when I put his style in the dictionary, the handlers stopped working. Now handlers will work, but triggers do not work. - Puro

0