[Category("SomeCat")]
[Description("Gets or sets how items are displayed in the ShellListView control.")]
[DefaultValue(View.Details)]
new public View View
{
get { return base.View; }
set
{
System.Diagnostics.Debug.WriteLine("View");
if (value != View.LargeIcon)
{
//Reset these values because they can only be true if LargeIcon is set.
ShowExtraLargeIcons = false;
}
base.View = value;
}
}
private bool m_ShowExtraLargeIcons;
[Category("Appearance")]
[DefaultValue(false)]
public bool ShowExtraLargeIcons
{
get { return m_ShowExtraLargeIcons; }
set
{
if (m_ShowExtraLargeIcons == value)
return;
System.Diagnostics.Debug.WriteLine("Extra");
m_ShowExtraLargeIcons = value;
if (m_ShowExtraLargeIcons)
// Always set view to LargeIcon if ShowExtraLargeIcons is enabled
View = View.LargeIcon;
}
}
私の問題: View を (VS 2010 のプロパティ マネージャーを介して) LargeIcons 以外に設定すると、ShowExtraLargeIcons プロパティは False に設定されていても True のままです。
ShowExtraLargeIcons を True に設定すると、View プロパティは予想どおり LargeIcons に設定されます。
役立つかもしれない何か:ShowExtraLargeIconsを設定した後のデバッグメッセージ(「View」と「Extra」)は表示されますが、Viewを設定した後は表示されません(両方とも設計時に設定されます)。