DependencyPropertyDescriptor.FromProperty no longer works in NET 4.0

I am porting some native 'framework' DLL and I am experiencing undefined behavior. I split the problem into the following:

I have a custom combobox with a dependency property

Public Class MyCombobox
Inherits ComboBox

Public Property MyString As String
    Get
        Return CInt(GetValue(MyStringProperty))
    End Get

    Set(ByVal value As String)
        SetValue(MyStringProperty, value)
    End Set
End Property

Public Shared ReadOnly MyStringProperty As DependencyProperty = DependencyProperty.Register("MyString", GetType(String), GetType(MyCombobox), New FrameworkPropertyMetadata())

End Class

      

When I call this code:

Dim descriptor As DependencyPropertyDescriptor = DependencyPropertyDescriptor.FromProperty(MyCombobox.MyStringProperty, New MyCombobox().GetType())

      

This returns

In .NET 3.5 -> Valid PropertyDescriptor

In .NET 4.0 -> Nothing, Niente, Nada, Null

Is this a bug in the .NET Framework? Is it out of date? Do I have any other options for accessing the descriptor?

+3
.net vb.net dependencies wpf


source to share


No one has answered this question yet

Check out similar questions:

1939
Difference between decimal, float and double in .NET?
841
Sending email in .NET via Gmail
780
How to enable build failure logging (Fusion) in .NET.
681
.NET String.Format () to add commas to thousands of number places
515
What additional configuration is needed to reference a .NET 2.0 mixed mode assembly in a .NET 4.0 project?
237
Does C # 6.0 work on .NET 4.0?
2
Wpf-Datagrid and ObservableCollection-AutoGenerateColumns?
1
Using dependency properties in wpf
0
Best way to pass connection object among forms?
0
WPF custom button control command not launching



All Articles
Loading...
X
Show
Funny
Dev
Pics