I am currently developing a GUI for the Ising model (German Wikipedia, because only the photograph on the right actually matters), which should consist of approximately 200x200 spin elements. I implemented this as follows:
<UniformGrid Name="grid" .... />
and added a rectangle for each spin in the code, behind which I update if the spin value changes. It was somehow very slow, and I changed it, so it uses the binding
<ItemsControl Name="IsingLattice" ItemsSource="{Binding Spins}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Name="grid" ...
...
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>
<Rectangle Fill={Binding Color} ...
but again it is very slow. I tried to debug and improve it for 3 days, but so far I have not achieved anything.
Now the question is: is my approach appropriate? What should be used instead, if so? If not, how can I improve performance?
, .
: , . , , , .