简体   繁体   English

Silverlight 3 Datagrid-临时突出显示一行

[英]Silverlight 3 Datagrid - Temporarily highlight a row

I'm using the Silverlight 3 datagrid and have a number of custom styles applied - for example, a row style with TargetType data:DataGridRow. 我正在使用Silverlight 3数据网格,并应用了许多自定义样式-例如,具有TargetType data:DataGridRow的行样式。 However, being very new to Silverlight I'm struggling to figure out how to achieve the following effect: highlight a row (temporarily, say for 2 seconds) when some property of the data item for that row changes. 但是,对于Silverlight来说还是很陌生,我正在努力寻找如何实现以下效果:当该行的数据项的某些属性更改时,突出显示一行(临时说2秒钟)。

I can iterate the row components on item update using code similar to the following: 我可以使用类似于下面的代码来迭代项目更新中的行组件:

foreach (Object p in CollectionView.View)
{
    TextBlock block = (TextBlock)Grid.Columns[0].GetCellContent(p);
    if (block != null && block.DataContext == recentlyUpdatedObject)
    {
        // effect rows visual state here
    }
}

So my main requirement is to apply the temporary highlight somehow to the row. 因此,我的主要要求是以某种方式将临时突出显示应用于行。

Any help would be greatly appreciated. 任何帮助将不胜感激。

fturtle tur

You could hook into some event as in this silverlight row color change post. 你可以挂接到一些事件在此Silverlight中排颜色变化后。

and then set off a timer and change the rows color back. 然后设置一个计时器,然后将行颜色改回来。

Still that seems a bit clunky. 不过,这似乎有点笨重。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM