[英]How to change a style when GridSplitter is focused in Silverlight 4
I have a Silverlight 4 Page. 我有一个Silverlight 4页。
The page contains a single grid, with three columns. 该页面包含一个网格,其中包含三列。 In the middle column, I have put the GridSplitter.
在中间一栏中,我放置了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. 我已经阅读了有关设置VisualState管理器的内容,但是我不确定在这种情况下如何利用它。 I've thought of using the triggers, but it seems that SL does not support them like the WPF does.
我已经考虑过使用触发器,但是SL似乎不像WPF那样支持它们。
How would I change the style depending on the focus state? 如何根据对焦状态更改样式?
The following article shows the default style and template for the GridSplitter control. 下面的文章显示了GridSplitter控件的默认样式和模板。 You can modify this style as you needed.
您可以根据需要修改此样式。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.