C
C
Cyril2015-06-26 10:48:11
WPF
Cyril, 2015-06-26 10:48:11

How to quickly create objects in WPF Grid?

Good afternoon!
There is a Grid, which is filled with dynamically created objects (podshamanenny UserControl). In fact - a hexagonal map. The object has literally one TextBlock element and a hexagon. There are already 32 thousand objects (well, that's how it happened). Accordingly, as soon as I start the creation of these objects, the program starts placing these objects in the Grid for a long time.
The question is how to do it faster? (precisely faster, and not in a separate thread) And maybe there are some approaches to tell Grid that I will now add many, many objects, please do not update, do not redraw, and in general ...
Even until I understand in which direction to dig.
Thanks in advance for your replies.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
AxisPod, 2015-06-26
@AxisPod

Well, first of all, there is confidence. that you don’t need a Grid, but you need a UniformGrid, it will work a little faster, but this will not help matters, in principle, Grid does not fit in your version.

S
Sumor, 2015-06-27
@Sumor

Check out the Virtualized WPF Canvas sample

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question