@ -158,6 +158,9 @@ namespace ICSharpCode.WpfDesign.PropertyGrid
}
}
}
}
/// <summary>
/// Gets whether the property node is enabled for editing.
/// </summary>
public bool IsEnabled {
public bool IsEnabled {
get {
get {
return ValueItem = = null & & hasStringConverter ;
return ValueItem = = null & & hasStringConverter ;
@ -176,19 +179,17 @@ namespace ICSharpCode.WpfDesign.PropertyGrid
}
}
}
}
public FontWeight FontWeight {
/// <summary>
get {
/// Gets the color of the name.
return IsSet ? FontWeights . Bold : FontWeights . Normal ;
/// Depends on the type of the value (binding/resource/etc.)
}
/// </summary>
}
public Brush NameForeground {
public Brush NameForeground {
get {
get {
if ( ValueItem ! = null ) {
if ( ValueItem ! = null ) {
if ( ValueItem . Component is BindingBase )
object component = ValueItem . Component ;
if ( component is BindingBase )
return Brushes . DarkGoldenrod ;
return Brushes . DarkGoldenrod ;
if ( ValueItem . Component is StaticResourceExtension | |
if ( component is StaticResourceExtension | | component is DynamicResourceExtension )
ValueItem . Component is DynamicResourceExtension )
return Brushes . DarkGreen ;
return Brushes . DarkGreen ;
}
}
return SystemColors . WindowTextBrush ;
return SystemColors . WindowTextBrush ;
@ -252,6 +253,9 @@ namespace ICSharpCode.WpfDesign.PropertyGrid
SetValueCore ( Unset ) ;
SetValueCore ( Unset ) ;
}
}
/// <summary>
/// Replaces the value of this node with a new binding.
/// </summary>
public void CreateBinding ( )
public void CreateBinding ( )
{
{
Value = new Binding ( ) ;
Value = new Binding ( ) ;
@ -309,6 +313,9 @@ namespace ICSharpCode.WpfDesign.PropertyGrid
Load ( properties ) ;
Load ( properties ) ;
}
}
/// <summary>
/// Initializes this property node with the specified properties.
/// </summary>
public void Load ( DesignItemProperty [ ] properties )
public void Load ( DesignItemProperty [ ] properties )
{
{
if ( this . Properties ! = null ) {
if ( this . Properties ! = null ) {
@ -375,6 +382,9 @@ namespace ICSharpCode.WpfDesign.PropertyGrid
#region INotifyPropertyChanged Members
#region INotifyPropertyChanged Members
/// <summary>
/// Occurs when a property has changed. Used to support WPF data binding.
/// </summary>
public event PropertyChangedEventHandler PropertyChanged ;
public event PropertyChangedEventHandler PropertyChanged ;
void RaisePropertyChanged ( string name )
void RaisePropertyChanged ( string name )