Skip to content

Initial display of templated controls is slow #1529

@ahopper

Description

@ahopper

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions