i'm trying to create a user control that acts as an IP address holder. Generally the control is composed of 4 TextBoxes that together has the full IP address. in the user control code behind there is a public property that holds the IP address of type IPAddress. I have been trying to expose this property so i could bind a property from my ViewModel to it.
here is the property from the user control i want to expose:
public IPAddress IPAddressObject
{
get
{
return new IPAddress(m_IPAddress);
}
set
{
m_IPAddress = value.GetAddressBytes();
NotifyPropertyChanged("Octet1");
NotifyPropertyChanged("Octet2");
NotifyPropertyChanged("Octet3");
NotifyPropertyChanged("Octet4");
}
}
its value gets updated correctly but i can't get the value into my ViewModel variable Using Binding. i know i need to use a dependency property in some way, but i don't know how to tie its value with my property.
thanks ahead :)