CSLA .NET

Vibrant discussion about CSLA .NET and using the framework to build great business applications.

Forum has moved

New location: CSLA .NET forum


CSLA .NET Resources:
  • CSLA .NET forum
  • CSLA .NET home page
  • ViewModelBase performance, solution

    rated by 0 users
    This post has 2 Replies | 2 Followers

    Top 500 Contributor
    Posts 34
    mesh Posted: Mon, Jun 17 2013 3:15 AM

    I'm experiencing some terrible performance with ViewModelBase (WPF) class. If changing Model properties or adding items to list, profiler is returning results that are hundreds of times slower then expected. I figured out that such performance is because of events attached in HookChangedEvents method?

    Solution may be to implement some disposable class, eg. BypassChangedEvents wich will wrap UnhookChangedEvents, HookChangedEvents and OnSetProperties.

    After that code that is changing Model may look like:

     

     

     

    using (BypassChangedEvents)
    {
    // Model.Property = something;
    // Model.Child.Add(item);
    // ...
    }

    mesh

    Top 10 Contributor
    Posts 9,475

    What events are you talking about? Custom events, or standard PropertyChanged events?

    Rocky

    Top 500 Contributor
    Posts 34
    mesh replied on Tue, Jun 18 2013 5:41 AM

    Standard PropertyChanged and ChildChanged events.

    mesh

    Page 1 of 1 (3 items) | RSS

    Copyright (c) 2006-2014 Marimer LLC. All rights reserved.
    Email admin@lhotka.net for support.
    Powered by Community Server (Non-Commercial Edition), by Telligent Systems