I have a control that I use for my new application. This control has the usual property as such.
Public Property Value() As String Get If AutoCompleteTextBox.SearchText Is Nothing Then Return String.Empty Else Return AutoCompleteTextBox.SearchText.ToString.Trim End If End Get Set(value As String) AutoCompleteTextBox.SearchText = value End Set End Property
Edit:
So, after several attempts, I am finally at this point.
Public Shared ValueProperty As DependencyProperty = DependencyProperty.Register("Value", GetType(String), GetType(AutoCompleteBox)) Public Property Value() As String Get Return Me.GetValue(ValueProperty).ToString End Get Set(value As String) Me.SetValue(ValueProperty, value) End Set End Property Public Event PropertyChanged As PropertyChangedEventHandler _ Implements INotifyPropertyChanged.PropertyChanged
This is a dependency property. This property is still optional. Errors do not appear in the output window for binding.
Text="{Binding RelativeSource={RelativeSource Self}, Path=Value, Mode=TwoWay}"
This is my binding method. I have no idea what else I can do. At least if there was a mistake, I could come up with something. Without any mistake, I'm just a toothless chicken.
source share