JD2022-TU1/main/tools/apps/ResourceViewer/PropertyGrid.xaml.cs

53 lines
1.7 KiB
C#

using System.Linq;
using System.Windows.Forms;
using UserControl = System.Windows.Controls.UserControl;
namespace ResourceViewer
{
/// <summary>
/// Interaction logic for PropertyGrid.xaml
/// </summary>
public partial class PropertyGrid : UserControl
{
public PropertyGrid()
{
InitializeComponent();
}
/// <summary>
/// Display or hide help panel
/// </summary>
public bool HelpVisible
{
get { return this.ResourcePropertyGrid.HelpVisible; }
set { this.ResourcePropertyGrid.HelpVisible = value; }
}
/// <summary>
/// Fake Select Object Inheritance
/// </summary>
public object[] SelectedObjects
{
get { return this.ResourcePropertyGrid.SelectedObjects; }
set { this.ResourcePropertyGrid.SelectedObjects = value; }
}
/// <summary>
/// Provide an event to be called when some of the property value changed
/// </summary>
/// <param name="eventHandler">the handler to be added</param>
public void RegisterPropertyValueChangedEventHandler(PropertyValueChangedEventHandler eventHandler)
{
this.ResourcePropertyGrid.PropertyValueChanged += eventHandler;
}
/// <summary>
/// Provide an event to be called when some of the property value changed
/// </summary>
/// <param name="eventHandler">the handler to be removed</param>
public void UnregisterPropertyValueChangedEventHandler(PropertyValueChangedEventHandler eventHandler)
{
this.ResourcePropertyGrid.PropertyValueChanged -= eventHandler;
}
}
}