1 // -------------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation. All Rights Reserved.
3 // -------------------------------------------------------------------
4 //From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\Properties
5 namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.PropertyInspector
8 using System.Diagnostics;
10 using System.Windows.Controls;
11 using System.Windows.Data;
12 using System.Activities.Presentation.PropertyEditing;
14 internal class StandardCategoryLayout : ItemsControl
16 public StandardCategoryLayout()
20 // This override is present to allow us to skip the automatically inserted ContentPresenter that ItemsControl
21 // generates by default. PrepareContainerForItemOverride sets up the DataContext and PropertyBinding as though
22 // it were contained within a ContentPresenter and had a Template that was <PropertyContainer Property="{Binding}" />.
23 protected override DependencyObject GetContainerForItemOverride()
25 return new PropertyContainer();
28 protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
30 PropertyContainer propertyContainer = element as PropertyContainer;
31 if (propertyContainer != null)
33 propertyContainer.DataContext = item;
34 propertyContainer.SetBinding(PropertyContainer.PropertyEntryProperty, new Binding());
37 base.PrepareContainerForItemOverride(element, item);