サーバー コントロールがあり、オブジェクトのリストであるプロパティを追加したいと考えています。このプロパティを、ドロップ ダウン リスト項目などと同様に、デザイナーを介して構成できるようにしたいと考えています。
プロパティを定義する試みは次のとおりです。
/// <summary>
/// Set this if you want to customize the export drop down options
/// </summary>
[Description("Customize the export drop down options if you do not want to use the defaults."), DefaultValue(null)]
[Category("Misc")]
[DesignerSerializationVisibility(
DesignerSerializationVisibility.Content),
Editor(typeof(List<MenuItem>), typeof(UITypeEditor)),
PersistenceMode(PersistenceMode.InnerDefaultProperty)]
public List<MenuItem> ExportMenuItems
{
get { return _ExportMenuItems; }
set { _ExportMenuItems = value; }
}
別の試みでは、MenuItemCollections を使用しました。
現在の問題は、デザイナーで [オブジェクト プロパティ] ウィンドウの省略記号ボタンをクリックすると、ウィンドウがポップアップしてすぐに消えることです。
これらのリンクを見てきましたが、これが必要かどうかわかりません: