Tutorial :WPF: Reset Colors to use template colors



Question:

I currently have a listboxitemcontainer, which if selected turns the background blue.

However later I programatically set : Border.Background = new solidcolorbrush(colors.white);

How do I reset the the border background now to use the template colors again? Now when I select the box again, it doesn't turn to the selection color anymore.


Solution:1

border.ClearValue(Border.BackgroundProperty);  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »