I have a table and many rows contain the same icon <Image Source="{Binding Icon}" /> (there is a set of 6 possible icons). I’ve noticed that table refresh takes significant amount of time because of those icons (they seem to be regenerated every time). In my program table refreshes very often – once in a 3 sec. Is there a way to optimize this? Maybe declare icon as resource so that it will load only once.
I have a table and many rows contain the same icon <Image Source={Binding Icon}
Share
I would suggest ensuring you only create the icon/image once per view model (I’m not keen on using static variables if possible). You should also call
Freeze()on the resource for maximum performance.e.g.
Also see this post: WPF image resources
which discusses the same problem.