All the controls missing in WPF. Over 1 million downloads.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

233 lines
11 KiB

<!--**************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2025 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
************************************************************************************-->
<local:DemoView x:Class="Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views.PropertyGridView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:s="clr-namespace:System;assembly=mscorlib"
VerticalScrollBarVisibility="Disabled"
Title="PropertyGrid">
<local:DemoView.Description>
<Paragraph FontSize="14"
FontFamily="Segoe">
The PropertyGrid control allows you to view and edit the properties of a specific object instance,
or values from a list of custom objects. This PropertyGrid allows you to autogenerate all properties
or specify the specific properties you want to display. You can use the standard editors that are provided
with the PropertyGrid or you can use custom editors that target a type, specific properties, or both.
The PropertyGrid also supports complex properties, which allows you to drill down into a nested property hierarchy.
</Paragraph>
</local:DemoView.Description>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<GroupBox Header="Features"
Grid.Row="0"
Margin="5">
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- 1st column-->
<TextBlock Text="Show Sumary:"
VerticalAlignment="Center" />
<CheckBox Grid.Column="1"
IsChecked="{Binding ShowSummary, ElementName=_propertyGrid}"
VerticalAlignment="Center"
Margin="5"
ToolTip="Shows/Hides the summary panel of the PropertyGrid." />
<TextBlock Text="Filter:"
VerticalAlignment="Center"
Grid.Row="1" />
<xctk:WatermarkTextBox Grid.Row="1"
Grid.Column="1"
Width="175"
Watermark="Search"
Text="{Binding Filter, ElementName=_propertyGrid, UpdateSourceTrigger=PropertyChanged}"
VerticalAlignment="Center"
Margin="5"
ToolTip="Filters the properties within the PropertyGrid." />
<TextBlock Text="IsReadOnly:"
VerticalAlignment="Center"
Grid.Row="2"
Grid.Column="0" />
<CheckBox Grid.Row="2"
Grid.Column="1"
IsChecked="{Binding IsReadOnly, ElementName=_propertyGrid}"
VerticalAlignment="Center"
Margin="5"
ToolTip="Set the IsReadOnly property to true or false." />
<TextBlock Text="ShowPreview:"
VerticalAlignment="Center"
Grid.Row="3"
Grid.Column="0" />
<CheckBox Grid.Row="3"
Grid.Column="1"
IsChecked="{Binding ShowPreview, ElementName=_propertyGrid}"
VerticalAlignment="Center"
Margin="5"
ToolTip="Shows/Hides the selected object preview." />
<!--2nd column-->
<TextBlock Text="Is Categorized:"
VerticalAlignment="Center"
Grid.Column="2"
Margin="10,0,0,0" />
<CheckBox Grid.Column="3"
IsChecked="{Binding IsCategorized, ElementName=_propertyGrid}"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the layout of the PropertyGrid." />
<TextBlock Text="Is Misc Category Label Hidden:"
VerticalAlignment="Center"
Grid.Row="1"
Grid.Column="2"
Margin="10,0,0,0" />
<CheckBox Grid.Row="1"
Grid.Column="3"
IsChecked="{Binding IsMiscCategoryLabelHidden, ElementName=_propertyGrid}"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets is the Misc Category label should be hidden." />
<TextBlock Text="Show Advanced Options:"
VerticalAlignment="Center"
Grid.Row="2"
Grid.Column="2"
Margin="10,0,0,0" />
<CheckBox Grid.Row="2"
Grid.Column="3"
IsChecked="{Binding ShowAdvancedOptions, ElementName=_propertyGrid}"
VerticalAlignment="Center"
Margin="5"
ToolTip="Shows/Hides the advanced options menu next to a property." />
<TextBlock Text="UpdateTextBoxSourceOnEnterKey:"
VerticalAlignment="Center"
Grid.Row="3"
Grid.Column="2"
Margin="10,0,0,0" />
<CheckBox Grid.Row="3"
Grid.Column="3"
IsChecked="{Binding UpdateTextBoxSourceOnEnterKey, ElementName=_propertyGrid}"
VerticalAlignment="Center"
Margin="5"
ToolTip="Update the source of a TextBox when True and Enter key is pressed." />
<!--Third Column-->
<TextBlock Text="Show Horizontal ScrollBar:"
VerticalAlignment="Center"
Grid.Column="4"
Margin="10,0,0,0" />
<CheckBox Grid.Column="5"
IsChecked="{Binding ShowHorizontalScrollBar, ElementName=_propertyGrid}"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets if the horizontal scrollBar will be showned." />
<TextBlock Text="HideInheritedProperties:"
VerticalAlignment="Center"
Grid.Row="1"
Grid.Column="4"
Margin="10,0,0,0" />
<CheckBox Grid.Row="1"
Grid.Column="5"
IsChecked="{Binding HideInheritedProperties, ElementName=_propertyGrid}"
VerticalAlignment="Center"
Margin="5"
ToolTip="When True, inherited properties are hidden." />
<TextBlock Text="IsVirtualizing:"
VerticalAlignment="Center"
Grid.Row="2"
Grid.Column="4"
Margin="10,0,0,0" />
<CheckBox Grid.Row="2"
Grid.Column="5"
IsChecked="{Binding IsVirtualizing, ElementName=_propertyGrid}"
VerticalAlignment="Center"
Margin="5"
ToolTip="Set if the PropertyGrid is using virtualization. Using virtualization will load the PropertyGrid faster with large dataSets." />
<TextBlock Text="PropertyNameLeftPadding:"
VerticalAlignment="Center"
Grid.Row="3"
Grid.Column="4"
Margin="10,0,0,0" />
<xctk:DoubleUpDown Grid.Row="3"
Grid.Column="5"
Value="{Binding PropertyNameLeftPadding, ElementName=_propertyGrid}"
Minimum="0"
Maximum="75"
VerticalAlignment="Center"
Margin="5"
ToolTip="Gets/Sets the spacing on the left of each property name." />
</Grid>
</GroupBox>
<DockPanel Grid.Row="1"
Margin="10">
<TextBlock DockPanel.Dock="Top"
Text="Usage:"
Style="{StaticResource Header}" />
<TextBlock DockPanel.Dock="Top"
Text="Edit the values in the PropertyGrid to see the effect on the button."
TextWrapping="Wrap" />
<Grid Margin="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150" />
<ColumnDefinition MaxWidth="530" />
</Grid.ColumnDefinitions>
<Button x:Name="_button"
Height="100"
Width="100"
Margin="20"
HorizontalAlignment="Center"
VerticalAlignment="Center">Button</Button>
<xctk:PropertyGrid Grid.Column="1"
x:Name="_propertyGrid"
ShowSummary="True"
Filter=""
IsCategorized="True"
ShowAdvancedOptions="True"
IsReadOnly="False"
IsVirtualizing="False"
UpdateTextBoxSourceOnEnterKey="True"
IsMiscCategoryLabelHidden="False"
ShowPreview="True"
HideInheritedProperties="False"
ShowHorizontalScrollBar="False"
PropertyNameLeftPadding="15"
SelectedObject="{Binding ElementName=_button}">
</xctk:PropertyGrid>
</Grid>
</DockPanel>
</Grid>
</local:DemoView>