Is it possible to use a setter to return a property to its default value?

It doesn't really work like that. The DependencyProperty system works by considering numerous different value sources. And as you can see here style setters and style triggers are considered to be separate sources.(They're numbered 8 and 6 respectively in the "Dependency Property Setting Precedence List" section.) Whichever of the active value sources has the highest priority wins Property sources of one kind cannot remove the value provided by a different source.

The only reason triggers are able to change the value from what a setter sets it to is that triggers have a higher priority. There's no power to eradicate a value supplied by a lower-priority source The way to achieve the particular goal you've expressed here would be to invert the sense of the trigger - don't define a style setter, and make the trigger active only when IsMouseOver is false. Of course, that won't help you in all the possible cases where you might want to do this.

But since there isn't a general solution, I think you'd need to solve each specific problem in its own way.

It doesn't really work like that. The DependencyProperty system works by considering numerous different value sources. And as you can see here, style setters and style triggers are considered to be separate sources.(They're numbered 8 and 6 respectively in the "Dependency Property Setting Precedence List" section.) Whichever of the active value sources has the highest priority wins.

Property sources of one kind cannot remove the value provided by a different source. The only reason triggers are able to change the value from what a setter sets it to is that triggers have a higher priority. There's no power to eradicate a value supplied by a lower-priority source.

The way to achieve the particular goal you've expressed here would be to invert the sense of the trigger - don't define a style setter, and make the trigger active only when IsMouseOver is false. Of course, that won't help you in all the possible cases where you might want to do this. But since there isn't a general solution, I think you'd need to solve each specific problem in its own way.

Good to know about those precedences, thank you for your answer. – H.B. Jan 16 at 21:06.

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