我正在開發一個自定義用戶控件。用戶控件具有映射到枚舉的屬性,並且不應該有任何默認值,即控件的使用者必須設置它。可以枚舉的枚舉值不會在智能感知或設計視圖中顯示
屬性:
<Description("This is the property description"),
Category("SomeCategory"), Bindable(True)>
Public Property SomeProperty As Enumerations.SomeEnumeration?
枚舉:
Namespace Enumerations
Public Enum SomeEnumeration
Zero = 0
One
Two
End Enum
End Namespace
的檢查:
If SomeProperty Is Nothing Then
Throw New ApplicationException("You must set SomeProperty.")
End If
問題:
所有的邏輯工作。我的問題是,當您嘗試從標記設置SomeProperty
時,沒有任何枚舉值在智能感知中顯示。我的一位同事發現this related support request,所以它似乎是一個已知的問題。
我的問題是,支持所有我需要在此控件上的行爲以及保持此屬性上的智能感知的最佳方式是什麼?
這很好用。謝謝 – jbabey