Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6838369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:35:18+00:00 2026-05-26T23:35:18+00:00

When reading the documentation it seems that WPF uses reflection to bind to CLR

  • 0

When reading the documentation it seems that WPF uses reflection to bind to CLR objects. In my app I bind a DataGrid to a IList<T> containing only 250 items (each with 8 properties). The DataGrid is using virtualization, so it only fetches the properties for 30 items or so. The properties are all simple strings, and still it takes several hundreds of milliseconds, which is way too long if you compare it to the 40 msecs it took to generate that list via a complex database query.

Are there any tricks to improve the binding time?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:35:19+00:00Added an answer on May 26, 2026 at 11:35 pm

    So, this is a guess, but It’s happened to me before and it’s worth a shot. Before guessing though, have you profiled your code to see exactly which calls are taking the most time? I believe you when you say that the time increases dramatically when using binding, but the suggestion I am about to give can be proven or disproven with profiling results. Anyway…

    I worked on an app a while ago that generated a lot of small UI elements. Each element was an instance of UserControl and used data binding for its appearance. I noticed that, when generating many (200+) of these elements there was an appreciable lag.

    We were using Prism and its ViewModelBase class, passing in delegates to the RaisePropertyChanged method, i.e.,

    private int _foo;
    public int Foo
    {
        get { return _foo; }
        set
        {
            if( _foo != value )
            {
                _foo = value;
                RaisePropertyChanged( this.Foo );  // trouble
            }
        }
    }
    

    The problem with this is that the implementation of RaisePropertyChanged must use reflection to get the property name as a string. When a lot (and I mean a lot) of these were being fired off there was a significant performance hit.

    The solution? Use a string instead of the function object. Yes, that’s really all it took. It stinks a bit as you have to remember to change two things if you ever refactor that property, but honestly the performance degradation is not worth it in many circumstances.

    Anyways, give it a shot. If a lot of CPU time is being spent inside RaisePropertyChanged that is likely why.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Reading the documentation it seems this might not be possible, but it seems that
reading the documentation for java org.w3c.dom.ls it seems as a Element only can be
By reading the documentation here it seems to me that re.compile(r'^[-\w]+$') would just search
Reading the documentation for menu_tree_page_data() , it seems to me that I should be
I know from reading Microsoft documentation that the "primary" use of the IDisposable interface
I am using reading the documentation for app domains in .net 3.5 and came
Reading Kohana's documentation, I found out that the main difference in 3.0 version is
From reading the documentation, it seems like you must send an array of bytes
I have been reading through Intuit's new IPP Federated App documentation. I am trying
I'm new to Java, and while reading documentation so far I can't find any

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.