dashboard-devexpress-dot-dashboardwin-dot-dashboarddesigner-58811629.md
Occurs when the custom property value in the Dashboard Designer is changed.
Namespace : DevExpress.DashboardWin
Assembly : DevExpress.Dashboard.v25.2.Win.dll
NuGet Package : DevExpress.Win.Dashboard
public event CustomPropertyChangedEventHandler DashboardCustomPropertyChanged
Public Event DashboardCustomPropertyChanged As CustomPropertyChangedEventHandler
The DashboardCustomPropertyChanged event's data class is CustomPropertyChangedEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| Name | Gets a custom property name for which the event is raised. |
| NewValue | Gets a new value that has been assigned to the custom property. |
| OldValue | Gets the custom property’s previous value, which has been replaced by the new value. |
| Owner | Gets a level at which a custom property is recorded. |
In comparison to the Dashboard.OptionsChanged and DashboardDesigner.DashboardOptionsChanged events, the DashboardCustomPropertyChanged event occurs when the custom property value is changed. The change does not have to be recorded in the history.
The following example shows how to change the ribbon button checked status when you enable or disable the custom property:
public class ChartScaleBreakModule {
// ...
public static readonly string PropertyName = "ScaleBreak";
void Designer_DashboardCustomPropertyChanged(object sender, CustomPropertyChangedEventArgs e) {
if(e.Name == PropertyName)
UpdateBarItem();
}
void UpdateBarItem() {
barItem.Checked = designer.SelectedDashboardItem.CustomProperties.GetValue<bool>(PropertyName);
}
public static T GetValue<T>(this CustomProperties property, string name) where T : struct {
var value = property.GetValue(name);
if(value == null) return default(T);
return (T)Convert.ChangeType(value, typeof(T));
}
}
Public Class ChartScaleBreakModule
' ...
Public Shared ReadOnly PropertyName As String = "ScaleBreak"
Private Sub Designer_DashboardCustomPropertyChanged(ByVal sender As Object, ByVal e As CustomPropertyChangedEventArgs)
If e.Name = PropertyName Then
UpdateBarItem()
End If
End Sub
Private Sub UpdateBarItem()
barItem.Checked = designer.SelectedDashboardItem.CustomProperties.GetValue(Of Boolean)(PropertyName)
End Sub
_
Public Shared Function GetValue(Of T As Structure)(ByVal [property] As CustomProperties, ByVal name As String) As T
Dim value = [property].GetValue(name)
If value Is Nothing Then
Return Nothing
End If
Return CType(Convert.ChangeType(value, GetType(T)), T)
End Function
End Class
The following code snippets (auto-collected from DevExpress Examples) contain references to the DashboardCustomPropertyChanged event.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
designer.CustomizeDashboardTitle += Designer_CustomizeDashboardTitle;
designer.DashboardCustomPropertyChanged += Designer_DashboardCustomPropertyChanged;
}
designer.CreateCustomItemBars(typeof(HeatmapItemMetadata));
designer.DashboardCustomPropertyChanged += UpdateBarsEventHandler;
designer.DashboardItemSelected += UpdateBarsEventHandler;
AddHandler designer.CustomizeDashboardTitle, AddressOf Designer_CustomizeDashboardTitle
AddHandler designer.DashboardCustomPropertyChanged, AddressOf Designer_DashboardCustomPropertyChanged
End Sub
designer.CreateCustomItemBars(GetType(HeatmapItemMetadata))
AddHandler designer.DashboardCustomPropertyChanged, AddressOf UpdateBarsEventHandler
AddHandler designer.DashboardItemSelected, AddressOf UpdateBarsEventHandler
DashboardCustomPropertyChanged
See Also