Click here to Skip to main content
15,894,106 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello there,

i'm wirting an mvvm-app based on josh smith's post (on MSDN Magazine).

There's the Repository, that contains a list of object. The Object are from the DataModel. I applied the concept of the Demo App to my Appliction. But i got some worker threads, that update the objects in the Repository.

In my App this List is shown in a ListView. The way this is done is the same as in the DemoApp. But as there is no implementation that would fire the PropertyChanged Event for a change of a property of the model, i don't exactly know where to implement this feature.

best
delicious_cake
Posted

i think this link [^] will help you
 
Share this answer
 
Comments
delicious cake 4-Jan-12 3:42am    
actually i'm trying to raise property changed , if i change some property of (referred to you help link) Customer! NOT CustomerViewModel
[no name] 4-Jan-12 4:24am    
Its a very huge document.

Please tell me the line number

or give some test block to search
[no name] 4-Jan-12 4:40am    
Put these line of code in RelayCommand class file



///
/// Raises the <see cref="CanExecuteChanged"> event.
///

[SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic",
Justification = "The this keyword is used in the Silverlight version")]
[SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate",
Justification = "This cannot be an event")]
public void RaiseCanExecuteChanged()
{
#if SILVERLIGHT
var handler = CanExecuteChanged;
if (handler != null)
{
handler(this, EventArgs.Empty);
}
#else
CommandManager.InvalidateRequerySuggested();
#endif
}

For more details please refer this

http://brianseekford.com/index.php/2010/07/14/delegatecommand-in-prism-loses-eventhandler-and-canexecute-never-gets-called/
delicious cake 4-Jan-12 7:50am    
sorry, but i don't know in what relation your answer stand with my problem. so here a small drawing of the application architecture (altough it's not complete) hosted here

the observable collection is of course a customerviewmodel list
Really, you could do with some service oriented design. Basically the service that updates your customer collection would then fire off an event to let your viewmodel know it needs updating. Thereby, recreating its ObservableCollection in a blunt implementation or for more sophistication, the event would have the changes in there ie. whether is was a deletion, update, add along with the model that has changed.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900