:
, A B C. B C . B C B C . B C
:
. .
, , , .
.
Client Address, :
public static class MyExtensions
{
public static void SendLetter(this Address address, string messageBody)
{
}
}
:
someClient.Addresses[0].SendLetter("Dear Sir, K THX BAI");
Address. , Address DependencyObject, , DependencyProperty:
public static class MyExtensionsWithData
{
public static readonly DependencyProperty PhoneProperty =
RegisterAttached("PhoneNumber",
typeof(string),
typeof(MyExtensionsWithData));
public static void SetPhoneNumber(this Address address, string phone)
{
address.SetValue(PhoneProperty, phone);
}
public static string GetPhoneNumber(this Address address)
{
return (string)address.GetValue(PhoneProperty);
}
}
, :
someClient.Addresses[0].SetPhoneNumber("5550945793847");
string phoneNum = someClient.Addresses[0].GetPhoneNumber();