1 //----------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation. All rights reserved.
3 //----------------------------------------------------------------
4 namespace System.Activities.Presentation.Internal.PropertyEditing.Resources
8 using System.Diagnostics;
9 using System.Diagnostics.CodeAnalysis;
10 using System.Globalization;
14 // Helper class that knows how to look up, load, and return PropertyInspector-specific
18 [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")]
19 internal class PropertyInspectorResources
21 private static ResourceDictionary sharedResources;
24 // Wrapper around System.Activities.Presentation.Internal.Properties.Resources.PropertyEditing_DefaultCollectionStringValue,
25 // which is internal and, hence, cannot be referenced from Xaml. We use this property to
26 // display "(Collection)" string in Xaml, rather than hard-coding it within Xaml, to make sure
27 // all of the translations of "(Collection)" string is the same, regardless whether the string
28 // comes from code or whether it comes from Xaml.
30 public static string DefaultCollectionStringValue
33 return System.Activities.Presentation.Internal.Properties.Resources.PropertyEditing_DefaultCollectionStringValue;
38 // Getter for the header representing the NameProperty. We don't want to hard-code that value in Xaml,
39 // because then it would get localized and, since it's technically a property name, we don't
40 // want it to get localized.
42 public static string NamePropertyHeader
46 CultureInfo.CurrentCulture,
47 System.Activities.Presentation.Internal.Properties.Resources.PropertyEditing_NamePropertyDisplayFormat,
48 FrameworkElement.NameProperty.Name);
53 // Wrapper around PropertyEditing_AlphabeticalCaption resource accessible from Xaml
55 public static string PropertyEditing_AlphabeticalCaption
58 return System.Activities.Presentation.Internal.Properties.Resources.PropertyEditing_AlphabeticalCaption;
63 // Wrapper around PropertyEditing_AlphabeticalCaption resource accessible from Xaml
65 public static string PropertyEditing_CategorizedCaption
68 return System.Activities.Presentation.Internal.Properties.Resources.PropertyEditing_CategorizedCaption;
73 // Wrapper around PropertyEditing_AlphabeticalCaption resource accessible from Xaml
75 public static string PropertyEditing_ClearButtonCaption
78 return System.Activities.Presentation.Internal.Properties.Resources.PropertyEditing_ClearButtonCaption;
83 // Gets the PropertyInspector-specific ResourceDictionary
85 // <returns></returns>
86 public static ResourceDictionary GetResources()
88 if (sharedResources == null)
90 Uri resourceLocator = new Uri(
92 typeof(PropertyInspectorResources).Assembly.GetName().Name,
93 @";component/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/Resources/StylesCore.xaml"),
94 UriKind.RelativeOrAbsolute);
96 sharedResources = (ResourceDictionary)Application.LoadComponent(resourceLocator);
99 Fx.Assert(sharedResources != null, "Could not load PropertyInspector shared resources.");
101 return sharedResources;