XAML中的行在observablecollection中添加了尽可能多的元素 [英] Rows in XAML added as many elements in observablecollection

查看:111
本文介绍了XAML中的行在observablecollection中添加了尽可能多的元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

XAML应该如何显示如果我想在ObservableCollection中添加尽可能多的对象?



我该怎么办?



我尝试了什么:



我不知道如何定义

How should XAML look like If I want to add as many rows as much objects there are in ObservableCollection ?

How am I supposed to do that ?

What I have tried:

I am not sure how to define

Grid.RowDefinitions>

Grid.ColumnDefinitions>

推荐答案

使用 DataGrid ListView ,并将集合绑定到 ItemsSource 属性。



请记住WPF性能随着大型集合而降低。这可以解决,但你必须谷歌寻求解决方案,因为这是一个很大的主题。您可以在CP上找到一篇讨论它的文章。
Use a DataGrid or ListView, and bind the collection to the ItemsSource property.

Keep in mind that WPF performance degrades with large collections. This can be addressed, but you'll have to google for the solution to that, because it's a big topic. You may be able to find an article on CP that discusses it.


这篇关于XAML中的行在observablecollection中添加了尽可能多的元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆