Search code examples
c#silverlightstylesvisualstatemanagergridsplitter

How to change a style when GridSplitter is focused in Silverlight 4


I have a Silverlight 4 Page.

The page contains a single grid, with three columns. In the middle column, I have put the GridSplitter.

By default it is blue. I can set its color using its Foreground property. However, when I drag (focus) the grid splitter, it changes its appearance to another color (some blueish color).

I'd like to define a style for the grid splitter which is applied when the splitter is focused, and another style when it's not.

I have read something about setting the VisualState manager, but I am not sure how to utilize it in this scenario. I've thought of using the triggers, but it seems that SL does not support them like the WPF does.

How would I change the style depending on the focus state?


Solution

  • The following article shows the default style and template for the GridSplitter control. You can modify this style as you needed.