PropertyGridControl Class
Definition
Surface hosting the WPF property grid.
Inheritance
Implements
Syntax
[TemplatePart(Name = "PART_Thumb", Type = typeof(Thumb))]
public class PropertyGridControl : Control, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient, IPropertyGridControl
Remarks
The PropertyGridControl control allows you to view and change the design-time properties and events of selected objects on the designed form by the FormDesignerControl.
The most important properties of the WPF PropertyGrid are:
SelectedItems � gets or sets the currently selected items.
PropertyBlacklist � gets or sets a list of property names excluded from the view.
Set the FormDesigner property to specify the Form Designer control associated with the PropertyGrid control.
Examples
Here is how to declare a PropertyGridControl and handle its events from the C# code:
public partial class Form1 : Form
{
private void Form1_Load(object sender, EventArgs e)
{
var propertyGrid = new Alternet.FormDesigner.Wpf.PropertyGrid.PropertyGridControl();
propertyGrid.FormDesigner = designer;
propertyGrid.PreFilterProperties += PropertyGridControl_PreFilterProperties;
}
private void PropertyGridControl_PreFilterProperties(object sender, Alternet.FormDesigner.Wpf.PropertyGrid.PreFilterPropertiesEventArgs e)
{
if (e.Property.Name.StartsWith("Auto"))
{
e.IsExcluded = true;
}
}
}
Here is how to declare a PropertyGridControl and handle its events from the Visual Basic code:
Partial Public Class Form1
Inherits Form
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim propertyGrid = New Alternet.FormDesigner.Wpf.PropertyGrid.PropertyGridControl()
propertyGrid.FormDesigner = designer
AddHandler propertyGrid.PreFilterProperties, AddressOf PropertyGridControl_PreFilterProperties
End Sub
Private Sub PropertyGridControl_PreFilterProperties(ByVal sender As Object, ByVal e As Alternet.FormDesigner.Wpf.PropertyGrid.PreFilterPropertiesEventArgs)
If e.[Property].Name.StartsWith("Auto") Then
e.IsExcluded = True
End If
End Sub
End Class
Constructors
PropertyGridControl() | Initializes a new instance of the |
PropertyGridControl(IPropertyGrid) | Initializes a new instance of the |
Fields
FirstColumnWidthProperty | Identifies the FirstColumnWidth dependency property. |
FormDesignerProperty | Identifies the FormDesigner dependency property. |
SelectedItemsProperty | Identifies the SelectedItems dependency property. |
Properties
ControlList | |
FirstColumnWidth | Gets or sets width of the first property grid column. |
FormDesigner | Gets or sets |
PropertyBlacklist | |
PropertyGrid | Represents a user interface for browsing the properties of an object. |
SelectedItems | Gets or sets the currently selected items. |
Methods
OnApplyTemplate() | Is invoked whenever application code or internal processes call System.Windows.FrameworkElement.ApplyTemplate. |
OnMouseRightButtonUp(MouseButtonEventArgs) | |
OnPropertyChanged(DependencyPropertyChangedEventArgs) |
Events
PreFilterProperties |