WPF Datagrid - 加载记录完成后设置鼠标光标
我有以下场景:
我们正在构建一个 WPF MVVM 应用程序。发送命令加载 mylist。数据源设置为 mygrid.ItemsSource = mylist。我需要在加载时将鼠标光标设置为 Cursors.Wait,并在加载完成后返回到 mylist Cursors.Arrow。该列表包含 1,000 条记录。但碰巧列表加载完成,数据网格在屏幕上记录的设计上有延迟。光标响应 mylist 的加载。
有没有办法在屏幕上记录设计完成后设置鼠标光标,而不是在mylist完成后设置鼠标光标?我已经对分页、EnableRowVirtualization 禁用进行了测试,即使这样,您也可以看到光标没有正确响应。
此致
I have the following scenario:
We're building a WPF MVVM application. Sending the command to load mylist. The DataSource is set to mygrid.ItemsSource = mylist. I need to set the mouse cursor to Cursors.Wait while it loads and return to mylist Cursors.Arrow after completion of loading. The list contains 1,000 records. But it happens that the loading of the list is completed and the datagrid has a delay on the design of the records on screen. The cursor responds to the loading of mylist.
Is there a way to set the mouse cursor after the completion of the design of records on screen and not the end of the completion of mylist? I have done tests with paging, EnableRowVirtualization disabling and even then, you can see that the cursor does not respond properly.
Best regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您从 ViewModel 发布提供数据加载和
DataGrid
的 xaml 片段的代码,那么帮助您会容易得多。目前还很难说什么。ps
mygrid.ItemsSource = mylist
对于 MVVM 来说看起来很奇怪It would be much easier to help you, if you post code from ViewModel that provides data loading and xaml-piece of
DataGrid
. For now it's hard to say anything.p.s.
mygrid.ItemsSource = mylist
looks pretty strange for MVVM