简体   繁体   English

当GridSplitter聚焦在Silverlight 4中时,如何更改样式

[英]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.

相关问题 当复选框/单选按钮处于焦点状态时,如何设置样式复选框/单选按钮? - How to set style checkbox/radiobutton when checkbox/radiobutton is focused? 在Silverlight中更改关键的烧烤风格 - Change key baised style in silverlight 选择并聚焦时如何更改数据网格单元格背景颜色? - How is it possible to change datagrid cell background color when is selected and focused? 如何使用Silverlight设置文本框样式 - How to style textbox with silverlight 有人可以向我展示如何在Silverlight XAML中设置样式的单选按钮以使其聚焦时(或更改其颜色)吗? - Can someone show me how to style a radiobutton in Silverlight XAML to outline it (or change it's color) when it get's focus? GridSplitter禁用我的RowDefinition样式 - GridSplitter disables my RowDefinition style 如果用户在控制加载之前更改 gridsplitter 的位置,则如何在 wpf c# 中将列/行附加到 GridSplitter - How to change position of gridsplitter if user change it before control loading inside column/row attach to GridSplitter in wpf c# 如何刷新VisualStateManager的“聚焦” VisualState的样式效果? - How to refresh style effects of 'Focused' VisualState of VisualStateManager? TextBox的样式,该样式应在聚焦时关闭样式更改 - Style for a TextBox which should turn off style changes when focused 使用Blend和WPF更改焦点文本框的边框样式 - Change the Border Style of a Focused Text Box using Blend and WPF
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM