silverlight - RIA services: Load returning no data -


in bookclub example application nikhilk kothary, combobox used display book categories.

it in viewmodel class (the application using mvvm pattern):

private referencedatacontext _referencedata;

public bookclubmodel() { // constructor _referencedata = new referencedatacontext();

_referencedata.load(_referencedata.getcategoriesquery(), false); 

}

then there property comboxbox bound:

public ienumerable categories { { return _referencedata.categories; } }

why working? shouldn't have "completed" event handler load operation?

if want fill ienumerable property in constructor, not working:

private referencedatacontext _referencedata;

private ienumerable _categories;

public bookclubmodel() { // constructor _referencedata = new referencedatacontext();

_referencedata.load(_referencedata.getcategoriesquery(), false);  _categories = _referencedata.categories; _referencedata.categories returning in categories property above. 

}

why work in 1 case , not other?

daniel

in first case categories reference _referencedata.categories. , when _referencedata.categories collection updated, categories updated.

in second case need event handler load operation, want loaded entities.

internally when call load, query database performing , when result fetched called load operation callback. load operation async operation , need keep in mind fact


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -