I've currently created the class below. For some reason though I can't access the properties I've created through my xaml style.
Public Class Ribbon : Inherits Button
Private mpopDropdown As Popup
Public Property Dropdown() As Popup
Get
Return mpopDropdown
End Get
Set(ByVal value As Popup)
mpopDropdown = value
End Set
End Property
...
End Class
<Style TargetType="{x:Type s:Ribbon}">
<Setter Property="Ribbon.Dropdown">
At this point there is an "Invalid PropertyDescriptor value" error.
What can I do to make this property accessible?
EDIT: I have tried creating a DependencyProperty
as well, as I've read this could solve my problem, but it didn't seem to.
EDIT 2: I've tried
Public Shared Readonly DropdownProperty as DependencyProperty = _
DependencyProperty.Register("Dropdown",GetType(Popup),GetType(Ribbon), _
New FrameworkPropertyMetadata(False))
and
Public Shared Readonly DropdownProperty as DependencyProperty = _
DependencyProperty.Register("Dropdown",GetType(Popup),GetType(Ribbon), _
New FrameworkPropertyMetadata(True))
but they don't seem to expose the property either. I've also tagged the property as <Bindable(True)>
but that didn't seem to do anything.
Any clue what I'm doing wrong?