Loga Ravi

Loga Ravi

  • NA
  • 77
  • 689

Assigning a value to a property from one class to another

Nov 28 2016 6:00 AM
Hi,
I am working in wpf-mvvm pattern.In that I have two classes.I need to assign a value to one property in a class, from the value of property in another class. Help me to solve this.
Example
public class A
{
 DateTime _NeedByDateHeader;
public DateTime NeedByDateHeader
{
get
{
return _NeedByDateHeader;
}
set
{
_NeedByDateHeader = value;
NotifyPropertyChanged("NeedByDateHeader");
}
}
 
public Class B{
 DateTime _NeedByDateLine ;
public DateTime NeedByDateLine
{
get
{
return _NeedByDateLine;
}
set
{
_NeedByDateLine = value;
NotifyPropertyChanged("NeedByDateLine");
}
}}
 
Here I need to assign NeedByDateHeader value to NeedByDateLine.If both properties in same class i can handle.But it is in two different classes. So help me.

Answers (2)