WPF performance checklist

30 בMarch 2017

אין תגובות

Actually I am not using WPF so much those days, but as a guide at community workshop it came out and I promised to publish those conclusions out, so here we go.. and it is dedicated to you fellows ..

Here is list of goodies:

1. Here is some gold rules can boost your app without great effort.

2. Remember Xaml item is a Class instance.

3. Since WPF use smart dependency property, ask yourself if every property you just seeing on your xaml file is really necessary.

It specially critical while talking about Designer’s code or generated Xaml code.

4. Minimize the visual tree.

5. Binding are expensive, yet can be boosted

Relative source binding is even more expensive

Try to sets binding Mode to minimum

Be carful with Binding errors on output window those are real exceptions

6. DynamicResource can also slow your app and cause bugs

7. Use Merge & lazy Resources as mush as can

8. HitTestable = false can save Event registrations for nothing

9. Dependency-property provide better Binding performance than CLR properties with INotifyPropertyChanged (in general)

10. For lists object use CanContentScroll=true and IsVistualizing = true

11. In Datagrid use

EnableColumnVirtualization = true

EnableRowVirtualization = true,

Binding=x, IsAsync = true

When working with large mount of data and the source change during runtime consider stop the binding make the change than connect the binding again,

Even if ItemsControl use virtualization the Connected Data isn’t, that means Big-Data on your app memory, you can implement self Data-Virtualization as binding source to increase app performance (no built in solution on the framework)

הוסף תגובה
facebook linkedin twitter email

Leave a Reply

Your email address will not be published. Required fields are marked *