Friday, August 30, 2013

how to access an XAML control from code

here is the class with the changes



public class Viapoints : INotifyPropertyChanged

{
private string _simpleAddress;
private string civicNumber;
private string civicName;
private string civicCity;
private string civicPostalCode;
private string civicProvince;
private string viaType;


public Viapoints()
{


}

public Viapoints(string simpleAddress, string viatype)
{
this._simpleAddress = simpleAddress;
this.ViaType = viatype;


}
public Viapoints(string cnumber, string cname, string ccity,string cpostalcode, string cprovince)
{
this.civicNumber = cnumber;
this.civicName = cname;
this.civicCity = ccity;
this.civicPostalCode = cpostalcode;
this.civicProvince = cprovince;
}

public string SimpleAddress
{
get { return _simpleAddress; }
set { _simpleAddress = value;
NotifyPropertyChanged();
}

}
public string ViaType
{
get { return viaType; }
set { viaType = value; }

}
public string CivicNumber
{
get { return civicNumber; }
set { civicNumber = value; }
}

public string CivicName
{
get { return civicName; }
set { civicName = value; }
}

public string CivicCity
{
get { return civicCity; }
set { civicCity = value; }
}

public string CivicPostalCode
{
get { return civicPostalCode; }
set { civicPostalCode = value; }
}

public string CivicProvince
{
get { return civicProvince; }
set { civicProvince = value; }
}

public event PropertyChangedEventHandler PropertyChanged;
private void NotifyPropertyChanged([CallerMemberName] String propertyName = "")
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}


}


No comments:

Post a Comment