[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 设置为 LargeIcons 以外的其他内容(通过 VS 2010 的属性管理器),ShowExtraLargeIcons 属性仍然为 True,尽管它已设置为 False。
如果我将 ShowExtraLargeIcons 设置为 True,则属性 View 将按预期设置为 LargeIcons。
可能有帮助的东西:设置 ShowExtraLargeIcons 后显示调试消息(“View”和“Extra”),在设置 View 后它们不显示(均在设计时设置)。