Hi,
I want to create a user telephone control in WPF.

I have tried many things but I can't seem to be able to pass a boolean dependency property. I think the problem has to do with the order in which the binding is processed.

Here is what I have:

user control telephone.xaml:
<telerik:RadMaskedTextBox
Name="mtbPhone"
MaskType="Standard"
..
Mask="{Binding ElementName=TelephoneControl, Path=PhoneMask}"
/>


user control telephone.xaml.vb:
Public Shared ReadOnly HasExtensionProperty As DependencyProperty = DependencyProperty.Register("HasExtension", GetType(Boolean), GetType(Telephone))
Public Property HasExtension() As Boolean
Get
Return CType(GetValue(HasExtensionProperty), Boolean)
End Get
Set(ByVal value As Boolean)
SetValue(HasExtensionProperty, value)
End Set
End Property
----
Public ReadOnly Property PhoneMask() As String

Get
If HasExtension() = True Then 'mask depends on dependency property
Return "(999) 999-9999 Ext:.9999"
Else
Return "(999) 999-9999"
End If

End Get

End Property

=======================
here is the xaml of a page that uses the telephone control
<customcontrols:Telephone Name="tlpMainTelephone"
...
HasExtension="True"

/>

=======================

When I debug, in the "PhoneMask" property of "telephone.xaml.vb" the HasExtension() statement always "False".

If HasExtension() = True Then 'HasExtension is always False !!!

Why am I getting False !!! I pass "True" in my calling page ?
<customcontrols:Telephone Name="tlpMainTelephone"
...
HasExtension="True"




Thanks in advance