diff --git a/Perspex.Controls/ItemsControl.cs b/Perspex.Controls/ItemsControl.cs index 4f053ab023..1d8d92b8e4 100644 --- a/Perspex.Controls/ItemsControl.cs +++ b/Perspex.Controls/ItemsControl.cs @@ -9,21 +9,23 @@ namespace Perspex.Controls using System; using System.Collections; using System.ComponentModel; + using System.Diagnostics.CodeAnalysis; using System.Linq; using Perspex.Controls.Generators; using Perspex.Controls.Primitives; public class ItemsControl : TemplatedControl { + [SuppressMessage("Microsoft.StyleCop.CSharp.NamingRules", "SA1202:ElementsMustBeOrderedByAccess", Justification = "Needs to be before or a NullReferenceException is thrown.")] + private static readonly ItemsPanelTemplate DefaultPanel = + new ItemsPanelTemplate(() => new StackPanel { Orientation = Orientation.Vertical }); + public static readonly PerspexProperty ItemsProperty = PerspexProperty.Register("Items"); public static readonly PerspexProperty ItemsPanelProperty = PerspexProperty.Register("ItemsPanel", defaultValue: DefaultPanel); - private static readonly ItemsPanelTemplate DefaultPanel = - new ItemsPanelTemplate(() => new StackPanel { Orientation = Orientation.Vertical }); - private ItemContainerGenerator itemContainerGenerator; public ItemsControl()