By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,165 Members | 1,235 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,165 IT Pros & Developers. It's quick & easy.

Implementing INotifyPropertyChanged with indexed properties

P: n/a
Hi,

I'm using indexed properties in an object which acts as the binding source.
How can I implement INotifyPropertyChanged for that object so that when the
indexed property is updated, binding target is updated?

To be more specific please find the code below..

public class ClassA : INotifyPropertyChanged

{

public object this[int field]

{

get

{

//Some code

}

set

{

//Some code

OnPropertyChanged(); // What is the parameter for OnPropertyChanged call???
}

}

#region INotifyPropertyChanged Members

public event PropertyChangedEventHandler PropertyChanged;

protected void OnPropertyChanged(string propName)

{

if (this.PropertyChanged != null)

{

PropertyChanged(this, new PropertyChangedEventArgs(propName));

}

}

#endregion

}
Thanks,

Gokul

Sep 7 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Gokul" <Go***@discussions.microsoft.coma écrit dans le message de news:
88**********************************@microsoft.com...

| I'm using indexed properties in an object which acts as the binding
source.
| How can I implement INotifyPropertyChanged for that object so that when
the
| indexed property is updated, binding target is updated?

The default indexer property of a class is called "Item" but, since you can
declare more than one indexer, I am not sure what the others are called.

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer
Sep 7 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.