Here is my UserControl:
Public Class Categories
Inherits UserControl
....
Private ReadOnly AddSplitProperty As DependencyProperty = DependencyProperty.Register("AddSplit", GetType(Boolean), GetType(Categories))
Public Property AddSplit As Boolean
Get
Return CBool(GetValue(AddSplitProperty))
End Get
Set(value As Boolean)
SetValue(AddSplitProperty, value)
End Property
End Class
The class Categories is used in a different Window as follows (PIM is the name of the application):
<Window
<Window
....
xmlns:self="clr-namespace:PIM"
....
<self:Categories AddSplit="True" />
....
</Window>
Running the application results in the following error:
System.ArgumentException
HResult=0x80070057
Message='AddSplit' property was already registered by 'Categories'.
Source=WindowsBase
(The above is supposed to be a quote but it gets saved as code.)
Apparently, 'AddSplit' is trying to be registered twice. Why?