here i am working on mvvm .i want to notify uodate in datgrid if any change in textbox occur.what is the code for that?
public void Save()
{if (IsNew)
_accountCategoryDataSource.Add(_accountCategory);
the above code for add data in database
and below code for loading data in datagrid for viewing
private void LoadAllAccounts()
{
_allAccounts =
(from account in _accountDataSource.GetAll() as List<Account>
select new AccountViewModel(account, _accountDataSource)).ToList();
Accounts = new ObservableCollection<AccountViewModel>(_allAccounts);
if (Accounts.Count > 0)
SelectedAccount = Accounts[0];
}`
BUT i can not have code for showing update in datagrid how it is done?
Is your datagrids ItemsSource property bound to that collection of Accounts? If so, do your Account class and AccountViewModel class implement INotifyPropertyChanged. If it does not, you must implement that interface to get changes propagated to the UI.
Take a look here for more info:
http://msdn.microsoft.com/en-us/library/ms743695.aspx