Class PropertyEditor
- Namespace
- NanoByte.Common.EtoControls
- Assembly
- NanoByte.Common.EtoForms.dll
Displays the public properties of an object and optionally allows editing them. A simplified alternative to the Windows Forms PropertyGrid.
public sealed class PropertyEditor : Scrollable, IHandlerSource, IDisposable, IBindable, IMouseInputSource, IKeyboardInputSource, ICallbackSource, IBindableWidgetContainer
- Inheritance
-
objectWidgetBindableWidgetControlContainerPanelScrollablePropertyEditor
- Implements
-
IHandlerSourceIBindableIMouseInputSourceIKeyboardInputSourceICallbackSourceIBindableWidgetContainer
- Inherited Members
-
Scrollable.ScrollEventScrollable.UpdateScrollSizes()Scrollable.ScrollPositionScrollable.ScrollSizeScrollable.BorderScrollable.VisibleRectScrollable.ExpandContentWidthScrollable.ExpandContentHeightScrollable.MinimumZoomScrollable.MaximumZoomScrollable.ZoomScrollable.ScrollPanel.Remove(Control)Panel.ControlsPanel.PaddingPanel.MinimumSizePanel.ContextMenuPanel.ContentContainer.RemoveAll()Container.ClientSizeContainer.ChildrenContainer.VisualChildrenContainer.StyleProviderContainer.StylesControl.SizeChangedEventControl.KeyDownEventControl.KeyUpEventControl.TextInputEventControl.MouseDownEventControl.MouseUpEventControl.MouseMoveEventControl.MouseLeaveEventControl.MouseEnterEventControl.MouseDoubleClickEventControl.MouseWheelEventControl.GotFocusEventControl.LostFocusEventControl.ShownEventControl.ThemeChangedEventControl.DragDropEventControl.DragOverEventControl.DragEnterEventControl.DragLeaveEventControl.DragEndEventControl.EnabledChangedEventControl.Invalidate()Control.Invalidate(Rectangle)Control.UpdateLayout()Control.GetPreferredSize()Control.GetPreferredSize(SizeF)Control.CaptureMouse()Control.ReleaseMouseCapture()Control.Detach()Control.AttachNative()Control.DetachNative()Control.Focus()Control.SuspendLayout()Control.ResumeLayout()Control.PointFromScreen(PointF)Control.PointToScreen(PointF)Control.RectangleToScreen(RectangleF)Control.RectangleFromScreen(RectangleF)Control.DoDragDrop(DataObject, DragEffects)Control.DoDragDrop(DataObject, DragEffects, Image, PointF)Control.TriggerStyleChanged()Control.Print()Control.IsDesignModeControl.GesturesControl.LoadedControl.VisualControlsControl.TagControl.LogicalParentControl.IsVisualControlControl.SizeControl.IsMouseCapturedControl.WidthControl.HeightControl.EnabledControl.VisibleControl.ParentControl.VisualParentControl.IsAttachedControl.BackgroundColorControl.HasFocusControl.IsSuspendedControl.ParentWindowControl.SupportedPlatformCommandsControl.BoundsControl.LocationControl.CursorControl.ToolTipControl.TabIndexControl.TabStopControl.AllowDropControl.SizeChangedControl.KeyDownControl.KeyUpControl.TextInputControl.MouseDownControl.MouseUpControl.MouseMoveControl.MouseLeaveControl.MouseEnterControl.MouseDoubleClickControl.MouseWheelControl.GotFocusControl.LostFocusControl.ShownControl.ThemeChangedControl.PreLoadControl.LoadControl.LoadCompleteControl.UnLoadControl.DragDropControl.DragOverControl.DragEnterControl.DragLeaveControl.DragEndControl.EnabledChangedBindableWidget.Unbind()BindableWidget.UpdateBindings(BindingUpdateMode)BindableWidget.ParentsBindableWidget.DataContextBindableWidget.BindingsBindableWidget.IsDataContextChangingBindableWidget.DataContextChangedWidget.Dispose()Widget.ToString()Widget.PlatformWidget.HandlerWidget.NativeHandleWidget.PropertiesWidget.IDWidget.StyleWidget.ControlObjectWidget.IsDisposedWidget.StyleChanged
- Extension Methods
Remarks
Respects BrowsableAttribute, CategoryAttribute, DisplayNameAttribute, DescriptionAttribute, DefaultValueAttribute, PasswordPropertyTextAttribute and RangeAttribute. Uses check boxes for bools, drop-downs for enums, numeric steppers for ints and text boxes with TypeConverters for everything else.
Constructors
PropertyEditor()
Creates a new property editor.
public PropertyEditor()
Properties
ReadOnly
Only display the property values, do not allow editing them.
public bool ReadOnly { get; set; }
Property Value
SelectedObject
The object whose properties are displayed; can be null.
public object? SelectedObject { get; set; }
Property Value
- object
Methods
CommitPendingChanges()
Applies any text input that has not been committed yet (e.g., because the control still has focus).
public void CommitPendingChanges()
Remarks
Call this before reading the SelectedObject, e.g., when the user clicks an OK button.
RefreshValues()
Updates the displayed values after the SelectedObject was modified externally.
public void RefreshValues()
Events
PropertyValueChanged
Occurs when the user changed a property value.
public event EventHandler? PropertyValueChanged