Solved

PropertyChangedEventArgs :: Property Name

Posted on 2010-11-14
4
602 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
Comment Utility

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
Comment Utility
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
Comment Utility
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
Comment Utility
Thankyou
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Windows Service with UDP 2 26
comparing string in C# 3 31
Hovering effect 9 28
Throws error on Decrypting String c# code 3 26
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

762 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

6 Experts available now in Live!

Get 1:1 Help Now