DashboardViewer.MaximizeDashboardItemAsync(String) Method
Expands the specified dashboard item to the entire dashboard size in an asynchronous task.
Namespace: DevExpress.DashboardWin
Assembly: DevExpress.Dashboard.v20.1.Win.dll
NuGet Packages: DevExpress.Win.Dashboard, DevExpress.WindowsDesktop.Win.Dashboard
Declaration
Parameters
Name | Type | Description |
---|---|---|
itemName | String | A String that is the dashboard item component name (the ComponentName property). |
Returns
Type | Description |
---|---|
Task | The task object that is the asynchronous operation to complete. |
Remarks
Use the DashboardViewer.RestoreDashboardItemAsync method to restore the maximized item to its previous size.
Example
This example demonstrates how to call the asynchronous maximize and restore methods to create a slide show with the dashboard items.
Note
Example on GitHub: How to Create a Slide Show with Asynchronous Maximize and Restore Methods
using DevExpress.XtraEditors;
using System;
using System.Windows.Forms;
namespace MaximizeSlideShow
{
public partial class ViewerForm1 : XtraForm {
bool isSlideShown = false;
int index = 0;
Timer slideShowTimer = new Timer() {
Interval = 5000
};
public ViewerForm1() {
InitializeComponent();
slideShowTimer.Tick += OnSlideShowTimerTick;
}
async void OnSlideShowTimerTick(object sender, EventArgs e) {
var items = dashboardViewer1.Dashboard.Items;
int maxIndex = items.Count - 1;
if(!isSlideShown) {
slideShowTimer.Stop();
return;
}
await dashboardViewer1.MaximizeDashboardItemAsync(items[index].ComponentName);
if(index == maxIndex)
index = 0;
else
index++;
}
void OnStartClick(object sender, MouseEventArgs e) {
if(!isSlideShown) {
isSlideShown = true;
slideShowTimer.Start();
}
}
async void OnStopClick(object sender, EventArgs e) {
isSlideShown = false;
await dashboardViewer1.RestoreDashboardItemAsync();
}
}
}
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the MaximizeDashboardItemAsync(String) method.
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.