Class PropertyGridControl
- Namespace
- Alternet.FormDesigner.Wpf.PropertyGrid
- Assembly
- Alternet.FormDesigner.Wpf.v10.dll
Surface hosting the WPF property grid.
[TemplatePart(Name = "PART_Thumb", Type = typeof(Thumb))]
public class PropertyGridControl : Control, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient, IPropertyGridControl
- Inheritance
-
PropertyGridControl
- Implements
- Extension Methods
Examples
Here is how to declare a PropertyGridControl and handle its events from the C# code:
using Alternet.FormDesigner.Wpf;
using Alternet.FormDesigner.Wpf.PropertyGrid;
public partial class MainWindow : Window
{
private void Window_Loaded(object sender, RoutedEventArgs e)
{
var formDesigner = new FormDesignerControl();
formDesigner.AutoSaveToSource = false;
var propertyGrid = new 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:
Imports Alternet.FormDesigner.Wpf
Imports Alternet.FormDesigner.Wpf.PropertyGrid
Partial Public Class MainWindow
Inherits Window
Private Sub Window_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
Dim formDesigner = New FormDesignerControl()
formDesigner.AutoSaveToSource = False
Dim propertyGrid = New 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
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.
Constructors
- PropertyGridControl()
Initializes a new instance of the
PropertyGridControl
class with default settings.
- PropertyGridControl(IPropertyGrid)
Initializes a new instance of the
PropertyGridControl
class with specified IPropertyGrid.
Fields
- FirstColumnWidthProperty
Identifies the FirstColumnWidth dependency property.
- FormDesignerProperty
Identifies the FormDesigner dependency property.
- SelectedItemsProperty
Identifies the SelectedItems dependency property.
Properties
- FirstColumnWidth
Gets or sets width of the first property grid column.
- FormDesigner
Gets or sets
IFormDesignerControl
bound to this property grid.
- 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)
Invoked when an unhandled MouseRightButtonUp routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
- OnPropertyChanged(DependencyPropertyChangedEventArgs)
Invoked whenever the effective value of any dependency property on this FrameworkElement has been updated. The specific dependency property that changed is reported in the arguments parameter. Overrides OnPropertyChanged(DependencyPropertyChangedEventArgs).