This repository has been archived by the owner on Oct 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DesignerForm1.vb
30 lines (27 loc) · 1.49 KB
/
DesignerForm1.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Imports DevExpress.DashboardWin
Imports System
Imports System.Linq
Namespace CustomShowDataExample
Partial Public Class DesignerForm1
Inherits DevExpress.XtraBars.Ribbon.RibbonForm
Public Sub New()
InitializeComponent()
AddHandler dashboardDesigner.CustomizeDashboardTitle, AddressOf DashboardDesigner_CustomizeDashboardTitle
dashboardDesigner.LoadDashboard("..\..\Dashboards\dashboard1.xml")
End Sub
#Region "#CustomizeDashboardTitle"
Private Sub DashboardDesigner_CustomizeDashboardTitle(ByVal sender As Object, ByVal e As DevExpress.DashboardWin.CustomizeDashboardTitleEventArgs)
Dim showDataParameter As DevExpress.Data.IParameter = dashboardDesigner.Parameters.FirstOrDefault(Function(p) p.Name = "ShowData")
If showDataParameter IsNot Nothing Then
Dim showData As Boolean = CBool(showDataParameter.Value)
Dim showDataItem As DashboardToolbarItem = New DashboardToolbarItem(showData, "Select states in the State list box and click this button to display data", New Action(Of DashboardToolbarItemClickEventArgs)(Sub(args)
showDataParameter.Value = Not showData
End Sub))
showDataItem.Caption = "Show Data"
showDataItem.SvgImage = svgImageCollection1(0)
e.Items.Insert(0, showDataItem)
End If
End Sub
#End Region ' #CustomizeDashboardTitle
End Class
End Namespace