[RESOLVED] Object of type 'System.Windows.Data.Binding' cannot be converted to type
Hello,
I've this usercontrol here: https://www.vbforums.com/showthread....ent&highlight=
that have the property SelectedEndianess
and in my app the the property:
Code:
Private Const m_Defaultendianess = 0
Private _myendianess As String = m_Defaultendianess
<DefaultValue(m_DefaultZoomV)>
Public Property myEndianess() As String
Get
Return _myendianess
End Get
Set(ByVal value As String)
SetAndNotify(_myendianess, value)
End Set
End Property
I'm trying to bind them so:
Code:
<local:myBitButton x:Name="mybtnBitButton" Grid.Row="1" EndianessChanged="{s:Action mybtnBitButton_EndianessChanged}" SelectedEndianess="{Binding myEndianess , UpdateSourceTrigger=PropertyChanged}" ></local:myBitButton>
but I'm getting this error: XDG0062 Object of type 'System.Windows.Data.Binding' cannot be converted to type 'System.String'.
Any advice?
Re: Object of type 'System.Windows.Data.Binding' cannot be converted to type
Four days on and no answers to this one? That's unusual.
Sadly I can't give a definitive answer, but usually when I'm confronted by "cannot be converted to type 'System.String'." I try to find somewhere to add ".ToString".
Poppa
Re: Object of type 'System.Windows.Data.Binding' cannot be converted to type
I solved: the problem was that in WPF to use databinding with usercontrol/custom control properties must implement dependency property.