views:

91

answers:

1

Maybe I am just over thinking this and need to write some more prototype code, but I wanted to get some of your thoughts:

Basically the application is going to be displaying up to several hundred custom visual objects in an X/Y "grid". The position and attributes of some of these objects may change between updates; the application will periodically retrieve updates via Web Service calls made approximately every minute.

My question is, what is the best way to process these updates on the client? I have considered either looking up each object and updating it directly, or constructing a "tree" of data objects that will be updated in a background thread - once all the updates have been applied in the background the displayed objects would be recreated based upon data in the "tree".

Can anyone offer any suggestions one way or the other? Are there any Silverlight design patterns that may be a good fit?

+3  A: 

I would use a data layer and bind to the properties in the XAML--ala m-v-c model-- and base your objects from INotifyPropertyChanged, then the UI will update 'em automatically when your data updates. Just make sure to compare the new value to the existing value

int SomeNumber 
{
    get { return this.m_someInt; }
    set { if ( value != this.m_someInt ) 
    {
        this.m_someInt = value;
        NotifyChange("SomeNumber");
    } 
}

NotifyChange( string propName )
{
.....
}
Muad'Dib
Thanks for the tip, I am going to go look into this...
Justin Ethier