How to define triggers in style in user control (WPF)?

You need to set the TargetType of the style to the type of your UserControl. Or you prefix all the properties with it.

You need to set the TargetType of the style to the type of your UserControl. Or you prefix all the properties with it. Regarding your other problem: The property needs a CLR-Wrapper: public static readonly DependencyProperty IsEditingProperty = DependencyProperty.

Register("IsEditing", typeof(Boolean), typeof(MyDetailDataControl), new UIPropertyMetadata(false)); // This: public Boolean IsEditing { get { return (Boolean)GetValue(IsEditingProperty); } set { SetValue(IsEditingProperty, value); } }.

If I use the arget type as TextBox, it doesn't solve the problem and I am getting this error: Property 'IsEditing' was not found in type 'TextBox'. – user654019 Jul 4 at 12:27 See my edits, I said the type of your UserControl, not its base class. – H.B.Jul 4 at 12:31 There are two style and two trigger.

Should I use both of them or one is enough? – user654019 Jul 4 at 12:34 @user, choose one of them. They both do the same, just with different syntax.

– svick Jul 4 at 12:37 @user: Those are the two different methods you can use. If you address more than one custom property i'd suggest using the first method.(Actually I would suggest that either way) – H.B.Jul 4 at 12:38.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions