Solved

PropertyChangedEventArgs :: Property Name

Posted on 2010-11-14
4
605 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:ewangoya
ewangoya earned 200 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 300 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
WPF - Tooltips for ComboBox items 5 40
I need help embedding an image as HTML in my vb.net application 3 50
Error on Add method 1 38
Visual Studio 2015 Source Code Control 10 38
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

863 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now