35fbce913074fb3918ea173a926b1544fef2ad0c
[mono.git] / mcs / class / referencesource / System.Activities.Presentation / System.Activities.Presentation / System / Activities / Presentation / Base / Core / Internal / PropertyEditing / CiderCategoryLayoutContainer.cs
1 //----------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation.  All rights reserved.
3 //----------------------------------------------------------------
4 namespace System.Activities.Presentation.Internal.PropertyEditing 
5 {
6     using System.Diagnostics.CodeAnalysis;
7     using System.Globalization;
8     using System.Windows;
9     using Blend = System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.PropertyInspector;
10     using System.Activities.Presentation.Internal.PropertyEditing.Selection;
11
12     // <summary>
13     // Container for CategoryEditors - fancy wrapper for ItemsControl that eliminates the need
14     // for extra bindings.
15     //
16     // This class is referenced from XAML
17     // </summary>
18     [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")]
19     internal class CiderCategoryLayoutContainer : Blend.CategoryLayoutContainer 
20     {
21
22         protected override void PrepareContainerForItemOverride(DependencyObject element, object item) 
23         {
24             base.PrepareContainerForItemOverride(element, item);
25
26             if (item != null) 
27             {
28                 string editorTypeName = item.GetType().Name;
29
30                 // Make each CategoryEditor its own selection stop
31                 PropertySelection.SetSelectionStop(element, new CategoryEditorSelectionStop(editorTypeName));
32             }
33         }
34     }
35 }