説明
UserControlのEasingModeのパブリック プロパティを宣言すると、Visual Studio のプロパティには表示されません。これは、他のカスタム プロパティではなく、 EasingModeだけの奇妙な動作です。
問題
EasingModeのプロパティがあれば、XAML で使用でき、有効なプロパティです。しかし、Visual StudioのPropertiesからこのプロパティにアクセスする必要があります。単純な列挙型の単純なパブリック プロパティは、他のように設計時にアクセスできる必要がありますが、EasingModeでは機能しません。
質問
プロパティの値をコードまたは XAML から直接変更できることは知っていますが、
- このプロパティがこの奇妙な動作をする理由を見つける必要があります。
- これを修正する方法は?この列挙型のプロパティがVisual Studio のデザイン タイムのプロパティパネルに表示されるようにするための解決策は何ですか?
例
この例を見てください
[Bindable(true)]
[Browsable(true)]
[Category("TEST")]
public EasingMode A1
{
get { return (EasingMode)this.GetValue(A1Property); }
set { this.SetValue(A1Property, value); }
}
public static readonly DependencyProperty A1Property = DependencyProperty.Register("A1", typeof(EasingMode), typeof(UserControl1));
[Bindable(true)]
[Browsable(true)]
[Category("TEST")]
public MessageBoxButton A2
{
get { return (MessageBoxButton)this.GetValue(A2Property); }
set { this.SetValue(A2Property, value); }
}
public static readonly DependencyProperty A2Property = DependencyProperty.Register("A2", typeof(MessageBoxButton), typeof(UserControl1));
A1 と A2 は単純な列挙型の単純なプロパティですが、A1 はVisual Studioの [プロパティ]パネルには表示されません。それをテストして見つけて、私を助けてください:)