Solved

PropertyChangedEventArgs :: Property Name

Posted on 2010-11-14
4
622 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

627 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