Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

PropertyChangedEventArgs :: Property Name

Posted on 2010-11-14
4
Medium Priority
?
628 Views
Last Modified: 2013-12-17
Hi Friends,

Can you give your ideas why   property  name   property  it is made virtual . What is the use  makeing its virtual ??

http://msdn.microsoft.com/en-us/library/system.componentmodel.propertychangedeventargs.propertyname.aspx


public virtual string PropertyName { get; }
0
Comment
Question by:N_Sri
  • 2
4 Comments
 
LVL 32

Assisted Solution

by:Ephraim Wangoya
Ephraim Wangoya earned 600 total points
ID: 34133464

You make it virtual so that in a descendat class, you can override the get or set method

class a
{
   public virtual string Name
  {
   get  { return "Base Name"; }
  }
}

class b : a
{
    public override string Name
   {
      get{return "Descendant Name";}
   }
}

Refere to this site, it has some good information
http://www.c-sharpcorner.com/UploadFile/rajeshvs/PropertiesInCS11122005001040AM/PropertiesInCS.aspx
0
 

Author Comment

by:N_Sri
ID: 34133484
Yeah I know that. But is the necessity in that class i.e PropertyChangedEventArgs  , to be virtual.

In which scenario  PropertyChangedEventArgs   property name will be  overidden in derived class
0
 
LVL 8

Accepted Solution

by:
dericstone earned 900 total points
ID: 34159415
I guess Microsoft just wanted to build in some flexibility. Here's an interesting article on PropertyChangedEventArgs:
http://msdn.microsoft.com/en-us/magazine/cc794276.aspx
0
 

Author Closing Comment

by:N_Sri
ID: 34161869
Thankyou
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Screencast - Getting to Know the Pipeline
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question