[reflection] Coop handles icalls in System.Reflection and System.RuntimeTypeHandle...
[mono.git] / mcs / class / referencesource / System.Activities.Presentation / System.Activities.Presentation / System / Activities / Presentation / Base / Core / Internal / PropertyEditing / Editors / SubPropertyViewEditor.cs
1 //----------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation.  All rights reserved.
3 //----------------------------------------------------------------
4 namespace System.Activities.Presentation.Internal.PropertyEditing.Editors 
5 {
6     using System;
7     using System.Windows;
8     using System.Activities.Presentation.PropertyEditing;
9     using System.Activities.Presentation.Internal.PropertyEditing.Resources;
10
11     // <summary>
12     // SubPropertyViewEditor is a "fake" value editor.  We only use it as a marker that exposes
13     // MarkerSubPropertyTemplate as its editor DataTemplates.  The XAML code for PropertyContainer
14     // specifically looks for these markers and it switches its InlineRowTemplate to a
15     // sub-property-specific inline row template when found.
16     // </summary>
17     internal class SubPropertyViewEditor : ExtendedPropertyValueEditor 
18     {
19
20         private static SubPropertyViewEditor _instance;
21
22         // This class can have a private ctor because we instantiate it through code,
23         // not through XAML or attributes
24         private SubPropertyViewEditor()
25             : base(
26             PropertyInspectorResources.GetResources()["MarkerSubPropertyTemplate"] as DataTemplate,
27             PropertyInspectorResources.GetResources()["MarkerSubPropertyTemplate"] as DataTemplate)
28         { 
29         }
30
31         // <summary>
32         // Gets the static instance of this class
33         // </summary>
34         public static SubPropertyViewEditor Instance 
35         {
36             get {
37                 if (_instance == null)
38                 {
39                     _instance = new SubPropertyViewEditor();
40                 }
41
42                 return _instance;
43             }
44         }
45     }
46 }