共用方式為


Avalon Performance: What is your Visual count?

The Avalon compositional UI model encourages you to create Styles and Templates (VisualTree in the May CTP build) that automatically generate visuals.  Build a complex Visual Tree and create a bunch of these automatically with data bound ListBoxes, and you can get into perf trouble.  Your XAML may be short and only show a couple of Grids and a ListBox, but the Visual count is through the roof.  That's what the TreeStatistics class in the last post is for.  Point it at the root of your tree and see how many Visuals you really have...that may explain why layout and rendering is taking so long...

Comments

  • Anonymous
    August 21, 2005

    Putting Constants in your XAML File? x:Static Is Your Friend.
    Building an Avalon application: Part...