Hello, I'm new to the forum and very new to silverlight. Myself and my coworker are working on a custom application. We are building a menu system that will only display buttons if that useris in an assigned role. A new property was created to allow roles to be defined, and for testing purposes we are simply trying to assign that value, which is a string, to a textblock's text property. Some code is attached.
This is one of the items to be added to the collection. the allowedroles property is passing the string, this can be seen via the debugger.
<MenuButton:VerticalButtonCollection x:Key="VerticalButtonsDS" d:IsDataSource="True">
<MenuButton:VerticalButton AllowedRoles="test, test2">
<TextBlock Text="{Binding AllowedRoles}"></TextBlock>
</MenuButton:VerticalButton>
</MenuButton:VerticalButtonCollection>
Code for the allowed roles property
Public Shared ReadOnly AllowedRolesProperty As DependencyProperty = DependencyProperty.Register("AllowedRoles", GetType(String), GetType(mButton), New PropertyMetadata(New PropertyChangedCallback(AddressOf onAllowedRolesChanged)))
Public Shared Sub onAllowedRolesChanged(ByVal d As DependencyObject, ByVal args As DependencyPropertyChangedEventArgs)
Dim sender As mButton = CType(d, mButton)
sender.AllowedRoles = CStr(args.NewValue)
End Sub
The items are displayed in a list box, there are no errors, but binding does not work. I even attempted to do the binding in the listbox's data template. I appologize if this is confusing, I dont' know how to post something like this in easy to understand pieces.
Thanks