I have a dialog with 140 checkboxes (not as silly as it might sound, they set hardware outputs), on first display it takes a couple of seconds. Simplifying the checkbox template reduces it to about 0.5 sec, this still looks bad in my app as the live graphical background freezes. Profiling indicates the time is spent in TemplatedControl.ApplyTemplate that is called by Measure. If the checkbox template is reduced to just a Border it still takes approx 20 times as long as showing 140 borders directly.
Is anything planned to improve this like compiling xaml or some other code generation of template factories?
I did wonder if in this case the template construction could be cached and cloned as the same template is used repeatedly, my initial attempts have failed.
I have a dialog with 140 checkboxes (not as silly as it might sound, they set hardware outputs), on first display it takes a couple of seconds. Simplifying the checkbox template reduces it to about 0.5 sec, this still looks bad in my app as the live graphical background freezes. Profiling indicates the time is spent in TemplatedControl.ApplyTemplate that is called by Measure. If the checkbox template is reduced to just a Border it still takes approx 20 times as long as showing 140 borders directly.
Is anything planned to improve this like compiling xaml or some other code generation of template factories?
I did wonder if in this case the template construction could be cached and cloned as the same template is used repeatedly, my initial attempts have failed.