向 DataGrid 中的某些行添加效果
这就是我想要的: 当用户单击按钮时,满足条件的所有行都应添加模糊效果
问题:我发现执行此操作的唯一方法是在 LoadingRow 事件中。但就我而言,当我想应用模糊效果时,该行已经加载。
问题:如何迭代行以便我可以应用模糊效果。或者,更好的是,如何将效果绑定到行?
这是我的代码,仅在启动时应用效果时才有效:
private void dg_LoadingRow(object sender, DataGridRowEventArgs e)
{
if (true) // Logic for figuring out if a row should be blur'ed
e.Row.Effect = new BlurEffect { Radius = 8 };
}
帮助
感谢Larsi 的
This is what I want:
When user clicks a button, all rows that meets a criteria should have a Blur effect added
Problem: The only way I've found to do this is in the LoadingRow event. But in my case the row is already loaded when I want to apply the Blur Effect.
Question: How to iterate over rows so that I can apply the Blur effect. Or, even better, how can I bind a Effect to a row?
This is my code that only works when applying effect on startup:
private void dg_LoadingRow(object sender, DataGridRowEventArgs e)
{
if (true) // Logic for figuring out if a row should be blur'ed
e.Row.Effect = new BlurEffect { Radius = 8 };
}
Thanks for any help
Larsi
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了一个解决方案:
像这样绑定到 DataGridCellPresenter 上的 Effect 属性:
转换器很简单:
Lars Erik
I found a solution to this:
Bind to the Effect property on the DataGridCellPresenter like this:
And the converter simply:
Lars Erik