├── .gitignore ├── Assemblies └── WPFToolkit.dll ├── LICENSE ├── LocalTestRun.testrunconfig ├── Main ├── WpfPropertyGrid.Themes │ ├── Kaxaml.cs │ ├── Kaxaml │ │ ├── IndexingStackPanel.cs │ │ ├── Reveal.cs │ │ └── Theme.xaml │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ ├── WpfPropertyGrid.Themes.csproj │ └── WpfPropertyGrid.snk └── WpfPropertyGrid │ ├── CategoryEditor.cs │ ├── CategoryItem.cs │ ├── Controls │ ├── DoubleEditor.cs │ ├── EnumDropdown.cs │ ├── SearchTextBox.cs │ └── SliderEditorBase.cs │ ├── Converters │ ├── DebugConverter.cs │ ├── EnumValueConverter.cs │ ├── ExpanderHeaderWidthConverter.cs │ ├── FontConverterDecorator.cs │ ├── FontStretchConverterDecorator.cs │ ├── FontStyleConverterDecorator.cs │ ├── FontWeightConverterDecorator.cs │ ├── MultiBooleanToVisibilityConverter.cs │ └── NullValueConverter.cs │ ├── CustomDictionary.xml │ ├── DataResource.cs │ ├── Design │ ├── AlphabeticalLayout.cs │ ├── AlphabeticalLayout.xaml │ ├── CategorizedLayout.cs │ ├── CategorizedLayout.xaml │ ├── CategoryContainer.cs │ ├── CategoryEditorContentPresenter.cs │ ├── CategoryItemsLayout.cs │ ├── ExtendedPropertyEditorTab.cs │ ├── GridEntryContainer.cs │ ├── GridEntryLayout.cs │ ├── PropertyContainer.cs │ ├── PropertyEditorContentPresenter.cs │ ├── PropertyItemsLayout.cs │ ├── PropertyNameTextBlock.cs │ ├── TabbedLayout.cs │ ├── TabbedLayout.xaml │ ├── TabbedLayoutItem.cs │ └── TabbedLayoutTemplateSelector.cs │ ├── Editor.cs │ ├── EditorCollection.cs │ ├── EditorKeys.cs │ ├── GridEntry.cs │ ├── GridEntryCollection.cs │ ├── Input │ ├── PropertyEditorCommands.cs │ └── PropertyGridCommands.cs │ ├── Internal │ ├── MathUtil.cs │ └── MergedPropertyDescriptor.cs │ ├── KnownTypes.cs │ ├── License.txt │ ├── Metadata │ ├── AttributesContainer.cs │ ├── BrowsableCategoryAttribute.cs │ ├── BrowsablePropertyAttribute.cs │ ├── CategoryEditorAttribute.cs │ ├── CategoryOrderAttribute.cs │ ├── FlatternHierarchyAttribute.cs │ ├── NumberRangeAttribute.cs │ ├── PropertyEditorAttribute.cs │ └── PropertyOrderAttribute.cs │ ├── MetadataRepository.cs │ ├── ObjectServices.cs │ ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings │ ├── PropertyDisplayMode.cs │ ├── PropertyEditing │ ├── CategoryItemComparer.cs │ ├── Filters │ │ ├── IPropertyFilterTarget.cs │ │ ├── PropertyFilter.cs │ │ ├── PropertyFilterAppliedEventArgs.cs │ │ └── PropertyFilterPredicate.cs │ ├── NamedColor.cs │ ├── NamedColorList.cs │ ├── PropertyItemComparer.cs │ ├── ValueExceptionEventArgs.cs │ └── ValueExceptionSource.cs │ ├── PropertyEditingEventArgs.cs │ ├── PropertyEditor.cs │ ├── PropertyGrid.Commands.cs │ ├── PropertyGrid.cs │ ├── PropertyGridUtils.cs │ ├── PropertyItem.cs │ ├── PropertyItemValue.cs │ ├── PropertyValueChangedEventArgs.cs │ ├── ResourceLocator.cs │ ├── Themes │ ├── DoubleEditor.xaml │ ├── EditorResources.xaml │ ├── Generic.xaml │ ├── Images │ │ ├── clear.png │ │ └── search.png │ ├── PropertyGrid.xaml │ └── SearchTextBox.xaml │ ├── TypeEditor.cs │ ├── Utils │ ├── PasswordBoxExtender.cs │ └── TextBoxExtender.cs │ ├── ValueEditors │ └── EditorResources.xaml │ ├── WpfPropertyGrid.csproj │ └── WpfPropertyGrid.snk ├── README ├── README.md ├── Samples ├── WPG.BrushCategory │ ├── App.xaml │ ├── App.xaml.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ ├── WPG.BrushCategory.csproj │ ├── Window1.xaml │ └── Window1.xaml.cs ├── WPG.CategoryEditor │ ├── App.xaml │ ├── App.xaml.cs │ ├── BusinessObject.cs │ ├── EditorKeys.cs │ ├── FontList.cs │ ├── FontSizeList.cs │ ├── FontStyleConverter.cs │ ├── FontWeightConverter.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ ├── WPG.CategoryEditor.csproj │ ├── Window1.xaml │ └── Window1.xaml.cs ├── WPG.ComplexProperty │ ├── App.xaml │ ├── App.xaml.cs │ ├── Female.cs │ ├── Human.cs │ ├── Male.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ ├── WPG.ComplexProperty.csproj │ ├── Window1.xaml │ └── Window1.xaml.cs ├── WPG.CustomTypeEditors │ ├── App.xaml │ ├── App.xaml.cs │ ├── BusinessObject.cs │ ├── Converters │ │ ├── DefaultPercentConverter.cs │ │ └── EmptyValueConverter.cs │ ├── CustomCategories │ │ ├── FontList.cs │ │ ├── FontSizeList.cs │ │ ├── FontStyleConverter.cs │ │ └── FontWeightConverter.cs │ ├── LocalResources.cs │ ├── MyEditors │ │ ├── FileBrowserDialogPropertyValueEditor.cs │ │ ├── OpenFileDialogOptionsAttribute.cs │ │ └── PointEditor.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ ├── WPG.CustomTypeEditors.csproj │ ├── Window1.xaml │ ├── Window1.xaml.cs │ └── XmlLanguageList.cs ├── WPG.DialogEditor │ ├── App.xaml │ ├── App.xaml.cs │ ├── BusinessObject.cs │ ├── EditorKeys.cs │ ├── FilePathPicker.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ ├── WPG.DialogEditor.csproj │ ├── Window1.xaml │ └── Window1.xaml.cs ├── WPG.ExtendedEditor │ ├── App.xaml │ ├── App.xaml.cs │ ├── MainWindow.xaml │ ├── MainWindow.xaml.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ ├── ViewModel.cs │ └── WPG.ExtendedEditor.csproj ├── WPG.Proxies │ ├── App.xaml │ ├── App.xaml.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ ├── TextBoxProxy.cs │ ├── WPG.Proxies.csproj │ ├── Window1.xaml │ └── Window1.xaml.cs └── WPG.WindowsFormsIntegration │ ├── BusinessObject.cs │ ├── Form1.Designer.cs │ ├── Form1.cs │ ├── Form1.resx │ ├── Program.cs │ ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings │ └── WPG.WindowsFormsIntegration.csproj ├── Tests └── WPG.UnitTests │ ├── CategoryEditorTest.cs │ ├── CategoryItemTest.cs │ ├── Converters │ ├── EnumValueConverterTest.cs │ ├── ExpanderHeaderWidthConverterTest.cs │ ├── FontStretchConverterDecoratorTest.cs │ ├── FontStyleConverterDecoratorTest.cs │ ├── FontWeightConverterDecoratorTest.cs │ ├── MultiBooleanToVisibilityConverterTest.cs │ └── NullValueConverterTest.cs │ ├── Design │ ├── AlphabeticalLayoutTest.cs │ ├── CategorizedLayoutTest.cs │ ├── CategoryContainerTest.cs │ ├── CategoryEditorContentPresenterTest.cs │ ├── CategoryItemsLayoutTest.cs │ ├── GridEntryContainerTest.cs │ ├── PropertyContainerTest.cs │ ├── PropertyEditorContentPresenterTest.cs │ ├── PropertyItemsLayoutTest.cs │ ├── PropertyNameTextBlockTest.cs │ └── TabbedLayoutTest.cs │ ├── EditorCollectionTest.cs │ ├── GridEntryCollectionTest.cs │ ├── Internal │ └── MathUtilTest.cs │ ├── Metadata │ ├── AttributesContainerTest.cs │ ├── BrowsableCategoryAttributeTest.cs │ ├── BrowsablePropertyAttributeTest.cs │ ├── CategoryEditorAttributeTest.cs │ ├── NumberRangeAttributeTest.cs │ ├── PropertyEditorAttributeTest.cs │ └── PropertyOrderAttributeTest.cs │ ├── MetadataRepositoryTest.cs │ ├── ObjectServicesTest.cs │ ├── Properties │ └── AssemblyInfo.cs │ ├── PropertyEditing │ ├── CategoryItemComparerTest.cs │ ├── Filters │ │ ├── PropertyFilterPredicateTest.cs │ │ └── PropertyFilterTest.cs │ ├── NamedColorTest.cs │ ├── PropertyItemComparerTest.cs │ └── ValueExceptionEventArgsTest.cs │ ├── PropertyEditorTest.cs │ ├── PropertyFilterAppliedEventArgsTest.cs │ ├── PropertyGridUtilsTest.cs │ ├── PropertyItemTest.cs │ ├── PropertyValueChangedEventArgsTest.cs │ ├── TypeEditorTest.cs │ ├── WPG.UnitTests.csproj │ └── WpfPropertyGrid.snk ├── WpfPropertyGrid.sln ├── WpfPropertyGrid.vsmdi └── WpfPropertyGrid1.vsmdi /.gitignore: -------------------------------------------------------------------------------- 1 | *.user 2 | *.suo 3 | *.sln.cache 4 | *.pdb 5 | [bB]in/ 6 | [oO]bj/ 7 | TestResults/ 8 | _ReSharper.* 9 | *.vssscc 10 | *.vspscc -------------------------------------------------------------------------------- /Assemblies/WPFToolkit.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DenysVuika/WPG/d99409ef377f6bd08309c84ea50980ebd182c618/Assemblies/WPFToolkit.dll -------------------------------------------------------------------------------- /LocalTestRun.testrunconfig: -------------------------------------------------------------------------------- 1 |  2 | 3 | This is a default test run configuration for a local test run. 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid.Themes/Kaxaml.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | using System.Windows.Markup; 17 | 18 | namespace System.Windows.Controls.WpfPropertyGrid.Themes 19 | { 20 | public class KaxamlTheme : ResourceDictionary, IComponentConnector 21 | { 22 | private bool isInitialized; 23 | 24 | public static ComponentResourceKey StyleKey 25 | { 26 | get { return new ComponentResourceKey(typeof(KaxamlTheme), "Style"); } 27 | } 28 | 29 | public KaxamlTheme() 30 | { 31 | InitializeComponent(); 32 | } 33 | 34 | #region IComponentConnector Members 35 | 36 | public void Connect(int connectionId, object target) 37 | { 38 | this.isInitialized = true; 39 | } 40 | 41 | public void InitializeComponent() 42 | { 43 | if (!isInitialized) 44 | { 45 | this.isInitialized = true; 46 | Uri resourceLocator = new Uri("/System.Windows.Controls.WpfPropertyGrid.Themes;component/Kaxaml/Theme.xaml", UriKind.Relative); 47 | Application.LoadComponent(this, resourceLocator); 48 | } 49 | } 50 | 51 | #endregion 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid.Themes/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | using System.Windows.Markup; 7 | 8 | // General Information about an assembly is controlled through the following 9 | // set of attributes. Change these attribute values to modify the information 10 | // associated with an assembly. 11 | [assembly: AssemblyTitle("WpfPropertyGrid.Themes")] 12 | [assembly: AssemblyDescription("Themes for WPF Property Grid")] 13 | [assembly: AssemblyConfiguration("")] 14 | [assembly: AssemblyCompany("")] 15 | [assembly: AssemblyProduct("WpfPropertyGrid.Themes")] 16 | [assembly: AssemblyCopyright("Copyright © 2010-2011 Denys Vuika")] 17 | [assembly: AssemblyTrademark("")] 18 | [assembly: AssemblyCulture("")] 19 | 20 | // Setting ComVisible to false makes the types in this assembly not visible 21 | // to COM components. If you need to access a type in this assembly from 22 | // COM, set the ComVisible attribute to true on that type. 23 | [assembly: ComVisible(false)] 24 | 25 | //In order to begin building localizable applications, set 26 | //CultureYouAreCodingWith in your .csproj file 27 | //inside a . For example, if you are using US english 28 | //in your source files, set the to en-US. Then uncomment 29 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 30 | //the line below to match the UICulture setting in the project file. 31 | 32 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 33 | 34 | 35 | [assembly: ThemeInfo( 36 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 37 | //(used if a resource is not found in the page, 38 | // or application resource dictionaries) 39 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 40 | //(used if a resource is not found in the page, 41 | // app, or any theme specific resource dictionaries) 42 | )] 43 | 44 | 45 | // Version information for an assembly consists of the following four values: 46 | // 47 | // Major Version 48 | // Minor Version 49 | // Build Number 50 | // Revision 51 | // 52 | // You can specify all the values or you can default the Build and Revision Numbers 53 | // by using the '*' as shown below: 54 | // [assembly: AssemblyVersion("2010.5.*")] 55 | [assembly: AssemblyVersion("2010.11.10")] 56 | [assembly: AssemblyFileVersion("2010.11.10")] 57 | 58 | [assembly: XmlnsDefinition("http://schemas.denisvuyka.wordpress.com/wpfpropertygrid", "System.Windows.Controls.WpfPropertyGrid.Themes")] -------------------------------------------------------------------------------- /Main/WpfPropertyGrid.Themes/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.1 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace System.Windows.Controls.WpfPropertyGrid.Themes.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid.Themes/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid.Themes/WpfPropertyGrid.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DenysVuika/WPG/d99409ef377f6bd08309c84ea50980ebd182c618/Main/WpfPropertyGrid.Themes/WpfPropertyGrid.snk -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/Converters/DebugConverter.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using System; 18 | using System.Diagnostics; 19 | using System.Globalization; 20 | using System.Windows.Data; 21 | 22 | namespace System.Windows.Controls.WpfPropertyGrid 23 | { 24 | /// 25 | /// Value converter that can be used for editor debugging purposes. 26 | /// 27 | public class DebugConverter : IValueConverter 28 | { 29 | #region IValueConverter Members 30 | 31 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 32 | { 33 | Debugger.Break(); 34 | return value; 35 | } 36 | 37 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 38 | { 39 | Debugger.Break(); 40 | return value; 41 | } 42 | 43 | #endregion 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/Converters/FontStretchConverterDecorator.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using System.ComponentModel; 18 | 19 | namespace System.Windows.Controls.WpfPropertyGrid 20 | { 21 | /// 22 | /// Extended that provides standard values collection. 23 | /// 24 | public sealed class FontStretchConverterDecorator : FontConverterDecorator 25 | { 26 | /// 27 | /// Initializes a new instance of the class. 28 | /// 29 | public FontStretchConverterDecorator() : base(new FontStretchConverter()) { } 30 | 31 | /// 32 | /// Returns a collection of standard values for the data type this type converter is designed for when provided with a format context. 33 | /// 34 | /// An that provides a format context that can be used to extract additional information about the environment from which this converter is invoked. This parameter or properties of this parameter can be null. 35 | /// 36 | /// A that holds a standard set of valid values, or null if the data type does not support a standard set of values. 37 | /// 38 | public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) 39 | { 40 | return new StandardValuesCollection( 41 | new[] 42 | { 43 | FontStretches.Condensed, 44 | FontStretches.Expanded, 45 | FontStretches.ExtraCondensed, 46 | FontStretches.ExtraExpanded, 47 | FontStretches.Normal, 48 | FontStretches.SemiCondensed, 49 | FontStretches.SemiExpanded, 50 | FontStretches.UltraCondensed, 51 | FontStretches.UltraExpanded 52 | }); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/Converters/FontStyleConverterDecorator.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using System.ComponentModel; 18 | 19 | namespace System.Windows.Controls.WpfPropertyGrid 20 | { 21 | /// 22 | /// Extended that provides standard values collection. 23 | /// 24 | public sealed class FontStyleConverterDecorator : FontConverterDecorator 25 | { 26 | /// 27 | /// Initializes a new instance of the class. 28 | /// 29 | public FontStyleConverterDecorator() : base(new FontStyleConverter()) { } 30 | 31 | /// 32 | /// Returns a collection of standard values for the data type this type converter is designed for when provided with a format context. 33 | /// 34 | /// An that provides a format context that can be used to extract additional information about the environment from which this converter is invoked. This parameter or properties of this parameter can be null. 35 | /// 36 | /// A that holds a standard set of valid values, or null if the data type does not support a standard set of values. 37 | /// 38 | public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) 39 | { 40 | return new StandardValuesCollection( 41 | new[] 42 | { 43 | FontStyles.Italic, 44 | FontStyles.Normal, 45 | FontStyles.Oblique 46 | }); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/Converters/FontWeightConverterDecorator.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using System.ComponentModel; 18 | 19 | namespace System.Windows.Controls.WpfPropertyGrid 20 | { 21 | /// 22 | /// Extended that provides standard values collection. 23 | /// 24 | public class FontWeightConverterDecorator : FontConverterDecorator 25 | { 26 | /// 27 | /// Initializes a new instance of the class. 28 | /// 29 | public FontWeightConverterDecorator() : base(new FontWeightConverter()) { } 30 | 31 | /// 32 | /// Returns a collection of standard values for the data type this type converter is designed for when provided with a format context. 33 | /// 34 | /// An that provides a format context that can be used to extract additional information about the environment from which this converter is invoked. This parameter or properties of this parameter can be null. 35 | /// 36 | /// A that holds a standard set of valid values, or null if the data type does not support a standard set of values. 37 | /// 38 | public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) 39 | { 40 | return new StandardValuesCollection( 41 | new[] 42 | { 43 | FontWeights.Thin, 44 | FontWeights.ExtraLight, 45 | FontWeights.Light, 46 | FontWeights.Normal, 47 | FontWeights.Medium, 48 | FontWeights.SemiBold, 49 | FontWeights.Bold, 50 | FontWeights.ExtraBold, 51 | FontWeights.Black, 52 | FontWeights.ExtraBlack }); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/CustomDictionary.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Orbifold 5 | 6 | 7 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/Design/AlphabeticalLayout.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace System.Windows.Controls.WpfPropertyGrid.Design 18 | { 19 | /// 20 | /// The default alphabetical view for properties. 21 | /// 22 | public class AlphabeticalLayout : Control 23 | { 24 | static AlphabeticalLayout() 25 | { 26 | DefaultStyleKeyProperty.OverrideMetadata(typeof(AlphabeticalLayout), new FrameworkPropertyMetadata(typeof(AlphabeticalLayout))); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/Design/AlphabeticalLayout.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 18 | 19 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/Design/CategorizedLayout.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace System.Windows.Controls.WpfPropertyGrid.Design 18 | { 19 | /// 20 | /// The default categorized view for properties. 21 | /// 22 | public class CategorizedLayout : Control 23 | { 24 | static CategorizedLayout() 25 | { 26 | DefaultStyleKeyProperty.OverrideMetadata(typeof(CategorizedLayout), new FrameworkPropertyMetadata(typeof(CategorizedLayout))); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/Design/CategorizedLayout.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 18 | 19 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/Design/CategoryContainer.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace System.Windows.Controls.WpfPropertyGrid 18 | { 19 | /// 20 | /// Specialized UI container for a category entry. 21 | /// 22 | public class CategoryContainer : GridEntryContainer 23 | { 24 | /// 25 | /// Initializes the class. 26 | /// 27 | static CategoryContainer() 28 | { 29 | DefaultStyleKeyProperty.OverrideMetadata(typeof(CategoryContainer), new FrameworkPropertyMetadata(typeof(CategoryContainer))); 30 | } 31 | 32 | /// 33 | /// Initializes a new instance of the class. 34 | /// 35 | public CategoryContainer() 36 | { 37 | SetParentContainer(this, this); 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/Design/CategoryEditorContentPresenter.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using System.Windows.Data; 18 | 19 | namespace System.Windows.Controls.WpfPropertyGrid.Design 20 | { 21 | /// 22 | /// Defines a content presenter control for a Category editor. 23 | /// 24 | public class CategoryEditorContentPresenter : ContentPresenter 25 | { 26 | /// 27 | /// Initializes a new instance of the class. 28 | /// 29 | public CategoryEditorContentPresenter() 30 | { 31 | var contentBinding = new Binding 32 | { 33 | RelativeSource = RelativeSource.Self, 34 | Path = new PropertyPath("(0).(1)", new[] { GridEntryContainer.ParentContainerProperty, GridEntryContainer.EntryProperty }) 35 | }; 36 | 37 | var contentTemplateBinding = new Binding 38 | { 39 | RelativeSource = RelativeSource.Self, 40 | Path = new PropertyPath("(0).EditorTemplate", new[] { GridEntryContainer.ParentContainerProperty }) 41 | }; 42 | 43 | SetBinding(ContentProperty, contentBinding); 44 | SetBinding(ContentTemplateProperty, contentTemplateBinding); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/Design/CategoryItemsLayout.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace System.Windows.Controls.WpfPropertyGrid.Design 18 | { 19 | /// 20 | /// Specifies a layout for categories. 21 | /// 22 | public class CategoryItemsLayout : GridEntryLayout 23 | { 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/Design/GridEntryLayout.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using System.Windows.Data; 18 | 19 | namespace System.Windows.Controls.WpfPropertyGrid.Design 20 | { 21 | /// 22 | /// Defines a basement for GridEntry UI layouts (panels, lists, etc) 23 | /// 24 | /// The type of elements in the control. 25 | public abstract class GridEntryLayout : ItemsControl where T: GridEntryContainer, new() 26 | { 27 | /// 28 | /// Creates or identifies the element that is used to display the given item. 29 | /// 30 | /// 31 | /// The element that is used to display the given item. 32 | /// 33 | protected override DependencyObject GetContainerForItemOverride() 34 | { 35 | return new T(); 36 | } 37 | 38 | /// 39 | /// Prepares the specified element to display the specified item. 40 | /// 41 | /// Element used to display the specified item. 42 | /// Specified item. 43 | protected override void PrepareContainerForItemOverride(DependencyObject element, object item) 44 | { 45 | var container = element as T; 46 | if (container != null) 47 | { 48 | container.DataContext = item; 49 | container.SetBinding(GridEntryContainer.EntryProperty, new Binding()); 50 | } 51 | base.PrepareContainerForItemOverride(element, item); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/Design/PropertyContainer.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace System.Windows.Controls.WpfPropertyGrid 18 | { 19 | /// 20 | /// Specialized UI container for a property entry. 21 | /// 22 | public class PropertyContainer : GridEntryContainer 23 | { 24 | /// 25 | /// Initializes the class. 26 | /// 27 | static PropertyContainer() 28 | { 29 | DefaultStyleKeyProperty.OverrideMetadata(typeof(PropertyContainer), new FrameworkPropertyMetadata(typeof(PropertyContainer))); 30 | } 31 | 32 | /// 33 | /// Initializes a new instance of the class. 34 | /// 35 | public PropertyContainer() 36 | { 37 | SetParentContainer(this, this); 38 | 39 | //PreviewMouseDown+=(sender, args) => MessageBox.Show(Entry.Name); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/Design/PropertyEditorContentPresenter.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using System.Windows.Data; 18 | 19 | namespace System.Windows.Controls.WpfPropertyGrid.Design 20 | { 21 | /// 22 | /// Defines a content presenter control for a Property editor. 23 | /// 24 | public sealed class PropertyEditorContentPresenter : ContentPresenter 25 | { 26 | /// 27 | /// Initializes a new instance of the class. 28 | /// 29 | public PropertyEditorContentPresenter() 30 | { 31 | var contentBinding = new Binding 32 | { 33 | RelativeSource = RelativeSource.Self, 34 | Path = new PropertyPath("(0).(1).PropertyValue", new[] { GridEntryContainer.ParentContainerProperty, GridEntryContainer.EntryProperty }) 35 | }; 36 | 37 | var contentTemplateBinding = new Binding 38 | { 39 | RelativeSource = RelativeSource.Self, 40 | Path = new PropertyPath("(0).EditorTemplate", new[] { GridEntryContainer.ParentContainerProperty }) 41 | }; 42 | 43 | SetBinding(ContentProperty, contentBinding); 44 | SetBinding(ContentTemplateProperty, contentTemplateBinding); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/Design/PropertyItemsLayout.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | namespace System.Windows.Controls.WpfPropertyGrid.Design 17 | { 18 | /// 19 | /// Specifies a layout for properties. 20 | /// 21 | public class PropertyItemsLayout : GridEntryLayout 22 | { 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/Design/PropertyNameTextBlock.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | using System.Windows.Input; 17 | 18 | namespace System.Windows.Controls.WpfPropertyGrid.Design 19 | { 20 | /// 21 | /// Specifies a property name presenter. 22 | /// 23 | public sealed class PropertyNameTextBlock : TextBlock 24 | { 25 | /// 26 | /// Initializes a new instance of the class. 27 | /// 28 | public PropertyNameTextBlock() 29 | { 30 | TextTrimming = TextTrimming.CharacterEllipsis; 31 | TextWrapping = TextWrapping.NoWrap; 32 | TextAlignment = TextAlignment.Right; 33 | VerticalAlignment = VerticalAlignment.Center; 34 | ClipToBounds = true; 35 | 36 | KeyboardNavigation.SetIsTabStop(this, false); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/Design/TabbedLayoutItem.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace System.Windows.Controls.WpfPropertyGrid.Design 18 | { 19 | /// 20 | /// Native Tab item for 21 | /// 22 | public partial class TabbedLayoutItem : TabItem 23 | { 24 | /// 25 | /// Initializes the class. 26 | /// 27 | static TabbedLayoutItem() 28 | { 29 | DefaultStyleKeyProperty.OverrideMetadata(typeof(TabbedLayoutItem), new FrameworkPropertyMetadata(typeof(TabbedLayoutItem))); 30 | } 31 | 32 | /// 33 | /// Identifies the dependency property. 34 | /// 35 | public static readonly DependencyProperty CanCloseProperty = 36 | DependencyProperty.Register("CanClose", typeof(bool), typeof(TabbedLayoutItem), new PropertyMetadata(false)); 37 | 38 | /// 39 | /// Gets or sets a value indicating whether this instance can close. 40 | /// 41 | /// true if this instance can close; otherwise, false. 42 | public bool CanClose 43 | { 44 | get { return (bool)GetValue(CanCloseProperty); } 45 | set { SetValue(CanCloseProperty, value); } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/Design/TabbedLayoutTemplateSelector.cs: -------------------------------------------------------------------------------- 1 | namespace System.Windows.Controls.WpfPropertyGrid.Design 2 | { 3 | public class TabbedLayoutTemplateSelector : DataTemplateSelector 4 | { 5 | private readonly ResourceLocator _resourceLocator = new ResourceLocator(); 6 | 7 | public override DataTemplate SelectTemplate(object item, DependencyObject container) 8 | { 9 | var category = item as CategoryItem; 10 | if (category != null) 11 | { 12 | var template = FindEditorTemplate(category); 13 | if (template != null) return template; 14 | } 15 | 16 | return base.SelectTemplate(item, container); 17 | } 18 | 19 | protected virtual DataTemplate FindEditorTemplate(CategoryItem category) 20 | { 21 | if (category == null) return null; 22 | 23 | var editor = category.Editor; 24 | 25 | if (editor == null) return null; 26 | 27 | var template = editor.InlineTemplate as DataTemplate; 28 | if (template != null) return template; 29 | 30 | return _resourceLocator.GetResource(editor.InlineTemplate) as DataTemplate; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/Input/PropertyEditorCommands.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | using System.Windows.Input; 17 | 18 | namespace System.Windows.Controls.WpfPropertyGrid 19 | { 20 | /// 21 | ///Provides a standard set of property editor related commands. 22 | /// 23 | public static class PropertyEditorCommands 24 | { 25 | private static readonly Type ThisType = typeof(PropertyEditorCommands); 26 | 27 | private static readonly RoutedUICommand _ShowDialogEditor = new RoutedUICommand("Show Dialog Editor", "ShowDialogEditorCommand", ThisType); 28 | private static readonly RoutedUICommand _ShowExtendedEditor = new RoutedUICommand("Show Extended Editor", "ShowExtendedEditorCommand", ThisType); 29 | 30 | /// 31 | /// Defines a command to show dialog editor for a property. 32 | /// 33 | public static RoutedUICommand ShowDialogEditor 34 | { 35 | get { return _ShowDialogEditor; } 36 | } 37 | 38 | /// 39 | /// Defines a command to show extended editor for a property. 40 | /// 41 | public static RoutedUICommand ShowExtendedEditor 42 | { 43 | get { return _ShowExtendedEditor; } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/Metadata/CategoryOrderAttribute.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | namespace System.Windows.Controls.WpfPropertyGrid 17 | { 18 | /// 19 | /// Specifies the order of category. 20 | /// 21 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = true, Inherited = true)] 22 | public sealed class CategoryOrderAttribute : Attribute 23 | { 24 | /// 25 | /// Gets the category name. 26 | /// 27 | public string Category { get; private set; } 28 | 29 | /// 30 | /// Gets the category order. 31 | /// 32 | /// The order. 33 | public int Order { get; private set; } 34 | 35 | /// 36 | /// Initializes a new instance of the class. 37 | /// 38 | /// The order. 39 | public CategoryOrderAttribute(string category, int order) 40 | { 41 | Category = category; 42 | Order = order; 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/Metadata/FlatternHierarchyAttribute.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | namespace System.Windows.Controls.WpfPropertyGrid 17 | { 18 | /// 19 | /// Specifies whether the property hierarchy should be flatterned for visualization. 20 | /// 21 | [AttributeUsage(AttributeTargets.Property, Inherited = false, AllowMultiple = false)] 22 | [Obsolete("This attribute is deprecated and is no longer supported by PropertyGrid. Please consider using custom type descriptors or ModelView classes in order to gain flattern behavior.", false)] 23 | public sealed class FlatternHierarchyAttribute : Attribute { } 24 | } 25 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/Metadata/NumberRangeAttribute.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | namespace System.Windows.Controls.WpfPropertyGrid 17 | { 18 | /// 19 | /// Specifies a range. 20 | /// 21 | [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] 22 | public sealed class NumberRangeAttribute : Attribute 23 | { 24 | /// 25 | /// Gets or sets the minimum. 26 | /// 27 | /// The minimum. 28 | public double Minimum { get; private set; } 29 | 30 | /// 31 | /// Gets or sets the maximum. 32 | /// 33 | /// The maximum. 34 | public double Maximum { get; private set; } 35 | 36 | /// 37 | /// Gets or sets the tick. 38 | /// 39 | /// The tick. 40 | public double Tick { get; private set; } 41 | 42 | /// 43 | /// Gets or sets the precision. 44 | /// 45 | /// The precision. 46 | public double Precision { get; private set; } 47 | 48 | /// 49 | /// Initializes a new instance of the class. 50 | /// 51 | /// The minimum. 52 | /// The maximum. 53 | /// The tick. 54 | public NumberRangeAttribute(double minimum, double maximum, double tick) 55 | : this(minimum, maximum, tick, 0) 56 | { 57 | } 58 | 59 | /// 60 | /// Initializes a new instance of the class. 61 | /// 62 | /// The minimum. 63 | /// The maximum. 64 | /// The tick. 65 | /// The precision. 66 | public NumberRangeAttribute(double minimum, double maximum, double tick, double precision) 67 | { 68 | Minimum = minimum; 69 | Maximum = maximum; 70 | Tick = tick; 71 | Precision = precision; 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/Metadata/PropertyOrderAttribute.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | namespace System.Windows.Controls.WpfPropertyGrid 17 | { 18 | /// 19 | /// Specifies the order of property. 20 | /// 21 | [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)] 22 | public sealed class PropertyOrderAttribute : Attribute 23 | { 24 | /// 25 | /// Gets or sets the order. 26 | /// 27 | /// The order. 28 | public int Order { get; private set; } 29 | 30 | /// 31 | /// Initializes a new instance of the class. 32 | /// 33 | /// The order. 34 | public PropertyOrderAttribute(int order) 35 | { 36 | Order = order; 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.1 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace System.Windows.Controls.WpfPropertyGrid.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/PropertyDisplayMode.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | namespace System.Windows.Controls.WpfPropertyGrid 17 | { 18 | /// 19 | /// Defines modes for property visualization. 20 | /// 21 | public enum PropertyDisplayMode 22 | { 23 | /// 24 | /// Show all properties. 25 | /// 26 | All, 27 | /// 28 | /// Show dependency properties only. 29 | /// 30 | Dependency, 31 | /// 32 | /// Show native CLR properties only. 33 | /// 34 | Native 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/PropertyEditing/CategoryItemComparer.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | using System.Collections.Generic; 17 | 18 | namespace System.Windows.Controls.WpfPropertyGrid 19 | { 20 | /// 21 | /// Default comparer. 22 | /// 23 | public class CategoryItemComparer : IComparer 24 | { 25 | #region IComparer Members 26 | 27 | /// 28 | /// Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other. 29 | /// 30 | /// The first object to compare. 31 | /// The second object to compare. 32 | /// 33 | /// Value 34 | /// Condition 35 | /// Less than zero 36 | /// is less than . 37 | /// Zero 38 | /// equals . 39 | /// Greater than zero 40 | /// is greater than . 41 | /// 42 | public int Compare(CategoryItem x, CategoryItem y) 43 | { 44 | if (x == y) return 0; 45 | if (x == null) return -1; 46 | if (y == null) return 1; 47 | 48 | int leftOrder = x.Order; 49 | int rightOrder = y.Order; 50 | 51 | if (leftOrder == rightOrder) 52 | return string.Compare(x.Name, y.Name, StringComparison.OrdinalIgnoreCase); 53 | 54 | return leftOrder.CompareTo(rightOrder); 55 | } 56 | 57 | #endregion 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/PropertyEditing/Filters/IPropertyFilterTarget.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | namespace System.Windows.Controls.WpfPropertyGrid 17 | { 18 | /// 19 | /// Describes an object that supports filtering. 20 | /// 21 | public interface IPropertyFilterTarget 22 | { 23 | /// 24 | /// Occurs when filter is applied for the entry. 25 | /// 26 | event EventHandler FilterApplied; 27 | 28 | /// 29 | /// Applies the filter for the entry. 30 | /// 31 | /// The filter. 32 | void ApplyFilter(PropertyFilter filter); 33 | 34 | /// 35 | /// Checks whether the entry matches the filtering predicate. 36 | /// 37 | /// The filtering predicate. 38 | /// true if entry matches filter; otherwise, false. 39 | bool MatchesPredicate(PropertyFilterPredicate predicate); 40 | 41 | /// 42 | /// Gets or sets a value indicating whether the entry matches filter. 43 | /// 44 | /// true if entry matches filter; otherwise, false. 45 | bool MatchesFilter { get; } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/PropertyEditing/Filters/PropertyFilterAppliedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | namespace System.Windows.Controls.WpfPropertyGrid 17 | { 18 | /// 19 | /// Contains state information and data related to FilterApplied event. 20 | /// 21 | public sealed class PropertyFilterAppliedEventArgs : EventArgs 22 | { 23 | /// 24 | /// Gets the filter. 25 | /// 26 | /// The filter. 27 | public PropertyFilter Filter { get; private set; } 28 | 29 | /// 30 | /// Initializes a new instance of the class. 31 | /// 32 | /// The filter. 33 | public PropertyFilterAppliedEventArgs(PropertyFilter filter) 34 | { 35 | Filter = filter; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/PropertyEditing/Filters/PropertyFilterPredicate.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | using System.Globalization; 17 | 18 | namespace System.Windows.Controls.WpfPropertyGrid 19 | { 20 | /// 21 | /// Property filter predicate. 22 | /// 23 | public class PropertyFilterPredicate 24 | { 25 | /// 26 | /// Gets or sets the match text. 27 | /// 28 | /// The match text. 29 | public string MatchText { get; private set; } 30 | 31 | /// 32 | /// Initializes a new instance of the class. 33 | /// 34 | /// The match text. 35 | public PropertyFilterPredicate(string matchText) 36 | { 37 | if (matchText == null) throw new ArgumentNullException("matchText"); 38 | MatchText = matchText.ToUpper(CultureInfo.CurrentCulture); 39 | } 40 | 41 | /// 42 | /// Matches the specified target. 43 | /// 44 | /// The target. 45 | /// true if target matches predicate; otherwise, false. 46 | public virtual bool Match(string target) 47 | { 48 | return ((target != null) && target.ToUpper(CultureInfo.CurrentCulture).Contains(MatchText)); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/PropertyEditing/NamedColor.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | using System.Windows.Media; 17 | 18 | namespace System.Windows.Controls.WpfPropertyGrid 19 | { 20 | /// 21 | /// Provides basic information for named colors. 22 | /// 23 | public sealed class NamedColor 24 | { 25 | #region Properties 26 | /// 27 | /// Gets or sets the name. 28 | /// 29 | /// The name. 30 | public String Name { get; private set; } 31 | 32 | /// 33 | /// Gets or sets the color. 34 | /// 35 | /// The color. 36 | public Color Color { get; private set; } 37 | 38 | /// 39 | /// Gets or sets the brush. 40 | /// 41 | /// The brush. 42 | public Brush Brush { get; private set; } 43 | #endregion 44 | 45 | #region ctor 46 | /// 47 | /// Initializes a new instance of the class. 48 | /// 49 | /// The name. 50 | /// The color. 51 | public NamedColor(string name, Color color) 52 | { 53 | if (string.IsNullOrEmpty(name)) throw new ArgumentNullException("name"); 54 | 55 | Name = name; 56 | Color = color; 57 | Brush = (Brush)new SolidColorBrush(color).GetAsFrozen(); 58 | } 59 | #endregion 60 | 61 | #region Overrides 62 | /// 63 | /// Returns a that represents the current . 64 | /// 65 | /// 66 | /// A that represents the current . 67 | /// 68 | public override String ToString() 69 | { 70 | return Name; 71 | } 72 | #endregion 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/PropertyEditing/NamedColorList.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | using System.Collections.ObjectModel; 17 | using System.Reflection; 18 | using System.Windows.Media; 19 | 20 | namespace System.Windows.Controls.WpfPropertyGrid 21 | { 22 | /// 23 | /// Provides a list of colors that is possible to bind to UI 24 | /// 25 | // For more details see http://shevaspace.spaces.live.com/blog/cns!FD9A0F1F8DD06954!435.entry 26 | public sealed class NamedColorList: ObservableCollection 27 | { 28 | /// 29 | /// Initializes a new instance of the class. 30 | /// 31 | public NamedColorList() 32 | { 33 | NamedColor nc; 34 | const MethodAttributes inclusiveAttributes = MethodAttributes.Static | MethodAttributes.Public; 35 | 36 | foreach (var pi in typeof(Colors).GetProperties()) 37 | { 38 | if (pi.PropertyType != typeof(Color)) continue; 39 | 40 | var mi = pi.GetGetMethod(); 41 | if ((mi == null) || ((mi.Attributes & inclusiveAttributes) != inclusiveAttributes)) continue; 42 | 43 | nc = new NamedColor(pi.Name, (Color)pi.GetValue(null, null)); 44 | Add(nc); 45 | } 46 | 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/PropertyEditing/PropertyItemComparer.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | using System.Collections.Generic; 17 | 18 | namespace System.Windows.Controls.WpfPropertyGrid 19 | { 20 | /// 21 | /// Default comparer. 22 | /// 23 | public class PropertyItemComparer : IComparer 24 | { 25 | /// 26 | /// Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other. 27 | /// 28 | /// The first object to compare. 29 | /// The second object to compare. 30 | /// 31 | /// Value 32 | /// Condition 33 | /// Less than zero 34 | /// is less than . 35 | /// Zero 36 | /// equals . 37 | /// Greater than zero 38 | /// is greater than . 39 | /// 40 | public virtual int Compare(PropertyItem x, PropertyItem y) 41 | { 42 | if (x == y) return 0; 43 | if (x == null) return -1; 44 | if (y == null) return 1; 45 | 46 | int leftOrder = 0; 47 | 48 | var attribute = x.GetAttribute(); 49 | if (attribute != null) 50 | leftOrder = attribute.Order; 51 | 52 | int rightOrder = 0; 53 | 54 | attribute = y.GetAttribute(); 55 | if (attribute != null) 56 | rightOrder = attribute.Order; 57 | 58 | int num = (leftOrder == rightOrder) ? 0 : leftOrder.CompareTo(rightOrder); 59 | if (num != 0) return num; 60 | 61 | return string.Compare(x.Name, y.Name, true); 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/PropertyEditing/ValueExceptionSource.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | namespace System.Windows.Controls.WpfPropertyGrid 17 | { 18 | /// 19 | /// Specifies the source of value exception 20 | /// 21 | public enum ValueExceptionSource 22 | { 23 | /// 24 | /// Exception occurred during a Get operation 25 | /// 26 | Get, 27 | /// 28 | /// Exception occurred during a Set operation 29 | /// 30 | Set 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/PropertyEditingEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | using System.ComponentModel; 17 | 18 | namespace System.Windows.Controls.WpfPropertyGrid 19 | { 20 | /// 21 | /// Encapsulates a method that contains an object and PropertyEditingEventArgs event arguments. 22 | /// 23 | public delegate void PropertyEditingEventHandler(object sender, PropertyEditingEventArgs e); 24 | 25 | public class PropertyEditingEventArgs : RoutedEventArgs 26 | { 27 | /// 28 | /// Gets property descriptor. 29 | /// 30 | // TODO: Replace with my wrapper? 31 | public PropertyDescriptor PropertyDescriptor { get; private set; } 32 | 33 | public PropertyEditingEventArgs(RoutedEvent routedEvent, object source, PropertyDescriptor propertyDescriptor) 34 | : base(routedEvent, source) 35 | { 36 | PropertyDescriptor = propertyDescriptor; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/PropertyGridUtils.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | using System.Collections.Generic; 17 | using System.Linq; 18 | 19 | namespace System.Windows.Controls.WpfPropertyGrid 20 | { 21 | internal static class PropertyGridUtils 22 | { 23 | public static IEnumerable GetAttributes(object target) 24 | { 25 | if (target == null) throw new ArgumentNullException("target"); 26 | return GetAttributes(target.GetType()); 27 | } 28 | 29 | public static IEnumerable GetAttributes(Type type) 30 | { 31 | if (type == null) throw new ArgumentNullException("type"); 32 | 33 | var attributes = 34 | from T attribute 35 | in type.GetCustomAttributes(typeof(T), true) 36 | select attribute; 37 | 38 | return attributes; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/PropertyValueChangedEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | namespace System.Windows.Controls.WpfPropertyGrid 17 | { 18 | /// 19 | /// Encapsulates a method that contains an object and PropertyValueChanged event arguments. 20 | /// 21 | public delegate void PropertyValueChangedEventHandler(object sender, PropertyValueChangedEventArgs e); 22 | 23 | /// 24 | /// Contains state information and data associated with property value change events. 25 | /// 26 | public sealed class PropertyValueChangedEventArgs : RoutedEventArgs 27 | { 28 | /// 29 | /// Gets the old value. 30 | /// 31 | /// The old value. 32 | public object OldValue { get; private set; } 33 | /// 34 | /// Gets the new value. 35 | /// 36 | /// The new value. 37 | public object NewValue { get; private set; } 38 | /// 39 | /// Gets the property. 40 | /// 41 | /// The property. 42 | public PropertyItem Property { get; private set; } 43 | 44 | /// 45 | /// Initializes a new instance of the class. 46 | /// 47 | /// The routed event. 48 | /// The property. 49 | /// The old value. 50 | public PropertyValueChangedEventArgs(RoutedEvent routedEvent, PropertyItem property, object oldValue) 51 | : base(routedEvent, property) 52 | { 53 | Property = property; 54 | NewValue = property.PropertyValue; 55 | OldValue = oldValue; 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/ResourceLocator.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010, Denys Vuika 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | namespace System.Windows.Controls.WpfPropertyGrid 17 | { 18 | /// 19 | /// Provides a unified approach for resolving resources. 20 | /// 21 | public class ResourceLocator 22 | { 23 | private readonly Application _application; 24 | 25 | /// 26 | /// Initializes a new instance of the class. 27 | /// 28 | public ResourceLocator() : this(Application.Current) { } 29 | 30 | /// 31 | /// Initializes a new instance of the class. 32 | /// 33 | /// The application instance. 34 | public ResourceLocator(Application application) 35 | { 36 | _application = application; 37 | } 38 | 39 | /// 40 | /// Gets the resource. 41 | /// 42 | /// The key. 43 | /// Object from resources. 44 | public virtual object GetResource(object key) 45 | { 46 | return _application.TryFindResource(key); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/Themes/DoubleEditor.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 30 | 31 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/Themes/Generic.xaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/Themes/Images/clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DenysVuika/WPG/d99409ef377f6bd08309c84ea50980ebd182c618/Main/WpfPropertyGrid/Themes/Images/clear.png -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/Themes/Images/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DenysVuika/WPG/d99409ef377f6bd08309c84ea50980ebd182c618/Main/WpfPropertyGrid/Themes/Images/search.png -------------------------------------------------------------------------------- /Main/WpfPropertyGrid/WpfPropertyGrid.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DenysVuika/WPG/d99409ef377f6bd08309c84ea50980ebd182c618/Main/WpfPropertyGrid/WpfPropertyGrid.snk -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DenysVuika/WPG/d99409ef377f6bd08309c84ea50980ebd182c618/README -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WPG 2 | WPF PropertyGrid Control 3 | 4 | Please refer to [Wiki](https://github.com/DenisVuyka/WPG/wiki) for more details. 5 | -------------------------------------------------------------------------------- /Samples/WPG.BrushCategory/App.xaml: -------------------------------------------------------------------------------- 1 |  7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Samples/WPG.BrushCategory/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Windows; 7 | 8 | namespace Samples.BrushCategory 9 | { 10 | /// 11 | /// Interaction logic for App.xaml 12 | /// 13 | public partial class App : Application 14 | { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Samples/WPG.BrushCategory/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("Samples.BrushCategory")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("Microsoft")] 14 | [assembly: AssemblyProduct("Samples.BrushCategory")] 15 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | //In order to begin building localizable applications, set 25 | //CultureYouAreCodingWith in your .csproj file 26 | //inside a . For example, if you are using US english 27 | //in your source files, set the to en-US. Then uncomment 28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 29 | //the line below to match the UICulture setting in the project file. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 36 | //(used if a resource is not found in the page, 37 | // or application resource dictionaries) 38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 39 | //(used if a resource is not found in the page, 40 | // app, or any theme specific resource dictionaries) 41 | )] 42 | 43 | 44 | // Version information for an assembly consists of the following four values: 45 | // 46 | // Major Version 47 | // Minor Version 48 | // Build Number 49 | // Revision 50 | // 51 | // You can specify all the values or you can default the Build and Revision Numbers 52 | // by using the '*' as shown below: 53 | // [assembly: AssemblyVersion("2010.5.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /Samples/WPG.BrushCategory/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.1 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Samples.BrushCategory.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Samples/WPG.BrushCategory/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Samples/WPG.BrushCategory/Window1.xaml: -------------------------------------------------------------------------------- 1 |  7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Brush category editor 16 | 17 | 18 | 19 | 20 | 21 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Samples/WPG.CategoryEditor/App.xaml: -------------------------------------------------------------------------------- 1 |  7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 27 | 32 | 33 | 34 | 39 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Samples/WPG.CategoryEditor/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Windows; 7 | 8 | namespace CategoryEditor 9 | { 10 | /// 11 | /// Interaction logic for App.xaml 12 | /// 13 | public partial class App : Application 14 | { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Samples/WPG.CategoryEditor/BusinessObject.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using System.Windows; 3 | using System.Windows.Media; 4 | using System.Windows.Controls.WpfPropertyGrid; 5 | 6 | namespace CategoryEditor 7 | { 8 | /// 9 | /// Sample business object 10 | /// 11 | [CategoryOrder("Text", 0)] 12 | [CategoryOrder("Misc", 1)] 13 | public class BusinessObject : INotifyPropertyChanged 14 | { 15 | #region Fields 16 | 17 | private string _name; 18 | private FontFamily _fontFamily = new FontFamily("Arial"); 19 | private double _fontSize = 8; 20 | private FontWeight _fontWeight = FontWeights.Bold; 21 | private FontStyle _fontStyle = FontStyles.Italic; 22 | 23 | #endregion 24 | 25 | 26 | 27 | public string Name 28 | { 29 | get { return _name; } 30 | set 31 | { 32 | if (_name == value) return; 33 | _name = value; 34 | OnPropertyChanged("Name"); 35 | } 36 | } 37 | 38 | #region Text-related properties 39 | 40 | [Category("Text")] 41 | public FontFamily FontFamily 42 | { 43 | get { return _fontFamily; } 44 | set 45 | { 46 | if (_fontFamily == value) return; 47 | _fontFamily = value; 48 | OnPropertyChanged("FontFamily"); 49 | } 50 | } 51 | 52 | [Category("Text")] 53 | public double FontSize 54 | { 55 | get { return _fontSize; } 56 | set 57 | { 58 | if (_fontSize == value) return; 59 | _fontSize = value; 60 | OnPropertyChanged("FontSize"); 61 | } 62 | } 63 | 64 | [Category("Text")] 65 | public FontWeight FontWeight 66 | { 67 | get { return _fontWeight; } 68 | set 69 | { 70 | if (_fontWeight == value) return; 71 | _fontWeight = value; 72 | OnPropertyChanged("FontWeight"); 73 | } 74 | } 75 | 76 | [Category("Text")] 77 | public FontStyle FontStyle 78 | { 79 | get { return _fontStyle; } 80 | set 81 | { 82 | if (_fontStyle == value) return; 83 | _fontStyle = value; 84 | OnPropertyChanged("FontStyle"); 85 | } 86 | } 87 | 88 | #endregion 89 | 90 | #region INotifyPropertyChanged Members 91 | 92 | public event PropertyChangedEventHandler PropertyChanged; 93 | 94 | protected void OnPropertyChanged(string propertyName) 95 | { 96 | var handler = PropertyChanged; 97 | if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName)); 98 | } 99 | 100 | #endregion 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /Samples/WPG.CategoryEditor/EditorKeys.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace CategoryEditor 4 | { 5 | public static class EditorKeys 6 | { 7 | private static readonly ComponentResourceKey textCategoryEditorKey = 8 | new ComponentResourceKey(typeof(EditorKeys), "TextCategoryEditor"); 9 | 10 | public static ComponentResourceKey TextCategoryEditorKey 11 | { 12 | get { return textCategoryEditorKey; } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Samples/WPG.CategoryEditor/FontList.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | using System.Windows.Media; 3 | 4 | namespace CategoryEditor 5 | { 6 | public class FontList : ObservableCollection 7 | { 8 | public FontList() 9 | { 10 | foreach (var ff in Fonts.SystemFontFamilies) 11 | { 12 | Add(ff); 13 | } 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Samples/WPG.CategoryEditor/FontSizeList.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | 3 | namespace CategoryEditor 4 | { 5 | public class FontSizeList : ObservableCollection 6 | { 7 | public FontSizeList() 8 | { 9 | Add(8); 10 | Add(9); 11 | Add(10); 12 | Add(11); 13 | Add(12); 14 | Add(14); 15 | Add(16); 16 | Add(18); 17 | Add(20); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Samples/WPG.CategoryEditor/FontStyleConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Windows; 4 | using System.Windows.Data; 5 | 6 | namespace CategoryEditor 7 | { 8 | public class FontStyleConverter : IValueConverter 9 | { 10 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 11 | { 12 | var fs = (FontStyle)value; 13 | return fs == FontStyles.Italic; 14 | } 15 | 16 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 17 | { 18 | if (value != null) 19 | { 20 | bool isSet = (bool)value; 21 | 22 | if (isSet) 23 | { 24 | return FontStyles.Italic; 25 | } 26 | } 27 | 28 | return FontStyles.Normal; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Samples/WPG.CategoryEditor/FontWeightConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Windows; 4 | using System.Windows.Data; 5 | 6 | namespace CategoryEditor 7 | { 8 | public class FontWeightConverter : IValueConverter 9 | { 10 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 11 | { 12 | var fw = (FontWeight)value; 13 | return fw == FontWeights.Bold; 14 | } 15 | 16 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 17 | { 18 | if (value != null) 19 | { 20 | bool isSet = (bool)value; 21 | 22 | if (isSet) 23 | { 24 | return FontWeights.Bold; 25 | } 26 | } 27 | 28 | return FontWeights.Normal; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Samples/WPG.CategoryEditor/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("CategoryEditor")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("Microsoft")] 14 | [assembly: AssemblyProduct("CategoryEditor")] 15 | [assembly: AssemblyCopyright("Copyright © Microsoft 2009")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | //In order to begin building localizable applications, set 25 | //CultureYouAreCodingWith in your .csproj file 26 | //inside a . For example, if you are using US english 27 | //in your source files, set the to en-US. Then uncomment 28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 29 | //the line below to match the UICulture setting in the project file. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 36 | //(used if a resource is not found in the page, 37 | // or application resource dictionaries) 38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 39 | //(used if a resource is not found in the page, 40 | // app, or any theme specific resource dictionaries) 41 | )] 42 | 43 | 44 | // Version information for an assembly consists of the following four values: 45 | // 46 | // Major Version 47 | // Minor Version 48 | // Build Number 49 | // Revision 50 | // 51 | // You can specify all the values or you can default the Build and Revision Numbers 52 | // by using the '*' as shown below: 53 | // [assembly: AssemblyVersion("2010.5.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /Samples/WPG.CategoryEditor/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.1 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CategoryEditor.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Samples/WPG.CategoryEditor/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Samples/WPG.CategoryEditor/Window1.xaml: -------------------------------------------------------------------------------- 1 |  8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Samples/WPG.CategoryEditor/Window1.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace CategoryEditor 4 | { 5 | public partial class Window1 : Window 6 | { 7 | public Window1() 8 | { 9 | InitializeComponent(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Samples/WPG.ComplexProperty/App.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Samples/WPG.ComplexProperty/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Windows; 7 | 8 | namespace ComplexProperty 9 | { 10 | /// 11 | /// Interaction logic for App.xaml 12 | /// 13 | public partial class App : Application 14 | { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Samples/WPG.ComplexProperty/Female.cs: -------------------------------------------------------------------------------- 1 | namespace ComplexProperty 2 | { 3 | public class Female : Human 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Samples/WPG.ComplexProperty/Human.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace ComplexProperty 4 | { 5 | public class Human : INotifyPropertyChanged 6 | { 7 | private string _name = "John"; 8 | private string _surname = "Doe"; 9 | 10 | [NotifyParentProperty(true)] 11 | public string Name 12 | { 13 | get { return _name; } 14 | set 15 | { 16 | if (_name == value) return; 17 | _name = value; 18 | OnPropertyChanged("Name"); 19 | } 20 | } 21 | 22 | public string Surname 23 | { 24 | get { return _surname; } 25 | set 26 | { 27 | if (_surname == value) return; 28 | _surname = value; 29 | OnPropertyChanged("Surname"); 30 | } 31 | } 32 | 33 | #region INotifyPropertyChanged Members 34 | 35 | public event PropertyChangedEventHandler PropertyChanged; 36 | 37 | protected void OnPropertyChanged(string propertyName) 38 | { 39 | var handler = PropertyChanged; 40 | if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName)); 41 | } 42 | 43 | #endregion 44 | 45 | public override string ToString() 46 | { 47 | return (string.IsNullOrEmpty(_name)) 48 | ? "(unknown)" 49 | : _name; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Samples/WPG.ComplexProperty/Male.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | namespace ComplexProperty 3 | { 4 | public class Male : Human 5 | { 6 | private Female _wife = new Female { Name = "Joan", Surname = "Doe" }; 7 | 8 | [TypeConverter(typeof(ExpandableObjectConverter))] 9 | public Female Wife 10 | { 11 | get { return _wife; } 12 | set 13 | { 14 | if (_wife == value) return; 15 | _wife = value; 16 | OnPropertyChanged("Wife"); 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Samples/WPG.ComplexProperty/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("ComplexProperty")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("Microsoft")] 14 | [assembly: AssemblyProduct("ComplexProperty")] 15 | [assembly: AssemblyCopyright("Copyright © Microsoft 2009")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | //In order to begin building localizable applications, set 25 | //CultureYouAreCodingWith in your .csproj file 26 | //inside a . For example, if you are using US english 27 | //in your source files, set the to en-US. Then uncomment 28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 29 | //the line below to match the UICulture setting in the project file. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 36 | //(used if a resource is not found in the page, 37 | // or application resource dictionaries) 38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 39 | //(used if a resource is not found in the page, 40 | // app, or any theme specific resource dictionaries) 41 | )] 42 | 43 | 44 | // Version information for an assembly consists of the following four values: 45 | // 46 | // Major Version 47 | // Minor Version 48 | // Build Number 49 | // Revision 50 | // 51 | // You can specify all the values or you can default the Build and Revision Numbers 52 | // by using the '*' as shown below: 53 | // [assembly: AssemblyVersion("2010.5.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /Samples/WPG.ComplexProperty/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.1 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ComplexProperty.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Samples/WPG.ComplexProperty/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Samples/WPG.ComplexProperty/Window1.xaml: -------------------------------------------------------------------------------- 1 |  8 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Samples/WPG.ComplexProperty/Window1.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Windows.Data; 8 | using System.Windows.Documents; 9 | using System.Windows.Input; 10 | using System.Windows.Media; 11 | using System.Windows.Media.Imaging; 12 | using System.Windows.Navigation; 13 | using System.Windows.Shapes; 14 | 15 | namespace ComplexProperty 16 | { 17 | /// 18 | /// Interaction logic for Window1.xaml 19 | /// 20 | public partial class Window1 : Window 21 | { 22 | public Window1() 23 | { 24 | InitializeComponent(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Samples/WPG.CustomTypeEditors/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Windows; 7 | 8 | namespace Sample4.CustomTypeEditors 9 | { 10 | /// 11 | /// Interaction logic for App.xaml 12 | /// 13 | public partial class App : Application 14 | { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Samples/WPG.CustomTypeEditors/Converters/DefaultPercentConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Data; 3 | 4 | namespace Sample4.CustomTypeEditors 5 | { 6 | public class DefaultPercentConverter : IValueConverter 7 | { 8 | #region IValueConverter Member 9 | 10 | 11 | 12 | public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 13 | { 14 | 15 | if (value != null) 16 | { 17 | 18 | string val = value.ToString(); 19 | 20 | val = val.Replace(".", ","); 21 | 22 | decimal dec = Decimal.Parse(val); 23 | 24 | 25 | 26 | //Komma verschieben 27 | 28 | int shiftFactor = (int)Math.Pow(10, 2); 29 | 30 | decimal tmp = dec * shiftFactor; 31 | 32 | 33 | 34 | //Runden: 0.5 addieren/subtrahieren und dann Nachkommastellen abschneiden 35 | 36 | decimal diff = (tmp >= 0 ? 0.5m : -0.5m); 37 | 38 | tmp = (long)(tmp + diff); 39 | 40 | 41 | 42 | //Komma wieder verschieben 43 | 44 | dec = (tmp / shiftFactor); 45 | 46 | val = dec.ToString(); 47 | 48 | 49 | 50 | int index = val.IndexOf(","); 51 | 52 | if (index == -1) 53 | 54 | val += ",00"; 55 | 56 | 57 | 58 | val += "%"; 59 | 60 | return val; 61 | 62 | } 63 | 64 | return "0,00%"; 65 | 66 | } 67 | 68 | public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 69 | { 70 | if (value != null) 71 | { 72 | string val = value.ToString(); 73 | val = val.Replace("%", ""); 74 | //decimal dec = Decimal.Parse(val); 75 | //return dec; 76 | } 77 | return value; 78 | } 79 | 80 | #endregion 81 | 82 | 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /Samples/WPG.CustomTypeEditors/Converters/EmptyValueConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Windows.Data; 4 | 5 | namespace Sample4.CustomTypeEditors 6 | { 7 | /// 8 | /// Specialized converter for keeping bindings alive. 9 | /// 10 | public class EmptyValueConverter : IValueConverter 11 | { 12 | #region IValueConverter Members 13 | 14 | /// 15 | /// Converts a value. 16 | /// 17 | /// The value produced by the binding source. 18 | /// The type of the binding target property. 19 | /// The converter parameter to use. 20 | /// The culture to use in the converter. 21 | /// 22 | /// A converted value. If the method returns null, the valid null value is used. 23 | /// 24 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 25 | { 26 | return value; 27 | } 28 | 29 | /// 30 | /// Converts a value. 31 | /// 32 | /// The value that is produced by the binding target. 33 | /// The type to convert to. 34 | /// The converter parameter to use. 35 | /// The culture to use in the converter. 36 | /// 37 | /// A converted value. If the method returns null, the valid null value is used. 38 | /// 39 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 40 | { 41 | return value; 42 | } 43 | 44 | #endregion 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Samples/WPG.CustomTypeEditors/CustomCategories/FontList.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | using System.Windows.Media; 3 | 4 | namespace Sample4.CustomTypeEditors 5 | { 6 | public class FontList : ObservableCollection 7 | { 8 | public FontList() 9 | { 10 | foreach (var ff in Fonts.SystemFontFamilies) 11 | { 12 | Add(ff); 13 | } 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Samples/WPG.CustomTypeEditors/CustomCategories/FontSizeList.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | 3 | namespace Sample4.CustomTypeEditors 4 | { 5 | public class FontSizeList : ObservableCollection 6 | { 7 | public FontSizeList() 8 | { 9 | Add(8); 10 | Add(9); 11 | Add(10); 12 | Add(11); 13 | Add(12); 14 | Add(14); 15 | Add(16); 16 | Add(18); 17 | Add(20); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Samples/WPG.CustomTypeEditors/CustomCategories/FontStyleConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Windows; 4 | using System.Windows.Data; 5 | 6 | namespace Sample4.CustomTypeEditors 7 | { 8 | public class FontStyleConverter : IValueConverter 9 | { 10 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 11 | { 12 | FontStyle fs = (FontStyle)value; 13 | return fs == FontStyles.Italic; 14 | } 15 | 16 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 17 | { 18 | if (value != null) 19 | { 20 | bool isSet = (bool)value; 21 | 22 | if (isSet) 23 | { 24 | return FontStyles.Italic; 25 | } 26 | } 27 | 28 | return FontStyles.Normal; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Samples/WPG.CustomTypeEditors/CustomCategories/FontWeightConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Windows; 4 | using System.Windows.Data; 5 | 6 | namespace Sample4.CustomTypeEditors 7 | { 8 | public class FontWeightConverter : IValueConverter 9 | { 10 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 11 | { 12 | var fs = (FontWeight)value; 13 | return fs == FontWeights.Bold; 14 | } 15 | 16 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 17 | { 18 | if (value != null) 19 | { 20 | bool isSet = (bool)value; 21 | 22 | if (isSet) 23 | { 24 | return FontWeights.Bold; 25 | } 26 | } 27 | 28 | return FontWeights.Normal; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Samples/WPG.CustomTypeEditors/LocalResources.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows; 3 | 4 | namespace Sample4.CustomTypeEditors 5 | { 6 | public static class LocalResources 7 | { 8 | private static readonly Type _ThisType = typeof(LocalResources); 9 | private static readonly ComponentResourceKey _FileBrowserEditorKey = new ComponentResourceKey(_ThisType, "FileBrowserEditorTemplate"); 10 | private static readonly ComponentResourceKey _PercentEditorKey = new ComponentResourceKey(_ThisType, "PercentEditorTemplate"); 11 | private static readonly ComponentResourceKey _XmlLanguageEditorKey = new ComponentResourceKey(_ThisType, "XmlLanguageEditorTemplate"); 12 | 13 | public static ComponentResourceKey FileBrowserEditorKey 14 | { 15 | get { return _FileBrowserEditorKey; } 16 | } 17 | 18 | public static ComponentResourceKey PercentEditorKey 19 | { 20 | get { return _PercentEditorKey; } 21 | } 22 | 23 | public static ComponentResourceKey XmlLanguageEditorKey 24 | { 25 | get { return _XmlLanguageEditorKey; } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Samples/WPG.CustomTypeEditors/MyEditors/FileBrowserDialogPropertyValueEditor.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | using System.Windows.Controls.WpfPropertyGrid; 3 | using Microsoft.Win32; 4 | 5 | namespace Sample4.CustomTypeEditors 6 | { 7 | // TODO: Refactoring needed! 8 | public class FileBrowserDialogPropertyValueEditor : Editor 9 | { 10 | public FileBrowserDialogPropertyValueEditor() 11 | { 12 | InlineTemplate = LocalResources.FileBrowserEditorKey; 13 | } 14 | 15 | public override void ShowDialog(PropertyItemValue propertyValue, IInputElement commandSource) 16 | { 17 | if (propertyValue == null) return; 18 | if (propertyValue.ParentProperty.IsReadOnly) return; 19 | 20 | var ofd = new OpenFileDialog(); 21 | ofd.Multiselect = false; 22 | 23 | var property = propertyValue.ParentProperty; 24 | if (property != null) 25 | { 26 | var optionsAttribute = (OpenFileDialogOptionsAttribute)property.Attributes[typeof(OpenFileDialogOptionsAttribute)]; 27 | if (optionsAttribute != null) 28 | optionsAttribute.ConfigureDialog(ofd); 29 | } 30 | 31 | if (ofd.ShowDialog() == true) 32 | propertyValue.StringValue = ofd.FileName; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Samples/WPG.CustomTypeEditors/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("Sample4.CustomTypeEditors")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("Sample4.CustomTypeEditors")] 15 | [assembly: AssemblyCopyright("Copyright © 2008")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | //In order to begin building localizable applications, set 25 | //CultureYouAreCodingWith in your .csproj file 26 | //inside a . For example, if you are using US english 27 | //in your source files, set the to en-US. Then uncomment 28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 29 | //the line below to match the UICulture setting in the project file. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 36 | //(used if a resource is not found in the page, 37 | // or application resource dictionaries) 38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 39 | //(used if a resource is not found in the page, 40 | // app, or any theme specific resource dictionaries) 41 | )] 42 | 43 | 44 | // Version information for an assembly consists of the following four values: 45 | // 46 | // Major Version 47 | // Minor Version 48 | // Build Number 49 | // Revision 50 | // 51 | // You can specify all the values or you can default the Build and Revision Numbers 52 | // by using the '*' as shown below: 53 | // [assembly: AssemblyVersion("2010.5.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /Samples/WPG.CustomTypeEditors/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.1 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Sample4.CustomTypeEditors.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Samples/WPG.CustomTypeEditors/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Samples/WPG.CustomTypeEditors/Window1.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Windows; 4 | using System.Windows.Controls.WpfPropertyGrid; 5 | 6 | namespace Sample4.CustomTypeEditors 7 | { 8 | /// 9 | /// Interaction logic for Window1.xaml 10 | /// 11 | public partial class Window1 12 | { 13 | readonly BusinessObject bo; 14 | 15 | public Window1() 16 | { 17 | InitializeComponent(); 18 | 19 | bo = new BusinessObject(); 20 | 21 | propertyGrid.SelectedObjectsChanged += propertyGrid_SelectedObjectsChanged; 22 | propertyGrid.SelectedObject = bo; 23 | propertyGrid.PropertyValueChanged += propertyGrid_PropertyValueChanged; 24 | } 25 | 26 | void propertyGrid_PropertyValueChanged(object sender, PropertyValueChangedEventArgs e) 27 | { 28 | 29 | } 30 | 31 | void propertyGrid_SelectedObjectsChanged(object sender, EventArgs e) 32 | { 33 | 34 | } 35 | 36 | private void btnTest_Click(object sender, RoutedEventArgs e) 37 | { 38 | PropertyItem prop = propertyGrid.Properties["Name"]; 39 | if (prop != null) 40 | { 41 | //prop.IsReadOnly = !prop.IsReadOnly; 42 | prop.IsBrowsable = !prop.IsBrowsable; 43 | } 44 | } 45 | 46 | static Random random = new Random(); 47 | 48 | private void btnSwitchObjects_Click(object sender, RoutedEventArgs e) 49 | { 50 | propertyGrid.SelectedObject = new BusinessObject 51 | { 52 | Name = Path.GetRandomFileName(), 53 | Password = Path.GetRandomFileName(), 54 | RegisteredDate = DateTime.Now, 55 | Integer1 = random.Next(1000), 56 | Integer2 = random.Next(1000), 57 | Integer3 = random.Next(1000), 58 | Integer4 = random.Next(1000), 59 | Attachment = Path.GetRandomFileName() 60 | }; 61 | 62 | //propertyGrid.Properties["Name"].SetPropertySouce(new BusinessObject { Name = Path.GetRandomFileName() }); 63 | } 64 | 65 | private void btnSelectMultiple_Click(object sender, RoutedEventArgs e) 66 | { 67 | object[] objects = new object[] 68 | { 69 | new BusinessObject { Name = "Denis Vuyka", Integer1 = 10 }, 70 | new BusinessObject { Name = "Marilyn Manson", Integer1 = 10 }, 71 | new BusinessObject { Name = "Charles Darvin", Integer1 = 10 } 72 | }; 73 | 74 | this.propertyGrid.SelectedObjects = objects; 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /Samples/WPG.CustomTypeEditors/XmlLanguageList.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | using System.Globalization; 3 | using System.Windows.Markup; 4 | 5 | namespace Sample4.CustomTypeEditors 6 | { 7 | public sealed class XmlLanguageList : ObservableCollection 8 | { 9 | public XmlLanguageList() 10 | { 11 | foreach (CultureInfo ci in CultureInfo.GetCultures(CultureTypes.AllCultures)) 12 | { 13 | if (string.IsNullOrEmpty(ci.IetfLanguageTag)) continue; 14 | Add(XmlLanguage.GetLanguage(ci.IetfLanguageTag)); 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Samples/WPG.DialogEditor/App.xaml: -------------------------------------------------------------------------------- 1 |  8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 23 | 24 |