Solved

PropertyChangedEventArgs :: Property Name

Posted on 2010-11-14
4
615 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 32

Assisted Solution

by:Ephraim Wangoya
Ephraim Wangoya 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

752 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