Version

Editing & Saving Dashboards

Overview

As described in Configuring the RevealView Object, you need to provide the RevealView component with the stream containing the dashboard file. In addition, you also might want to handle what to do with the modified dashboard file, once the user made changes to the dashboard.

Saving dashboards

You can attach to the SaveDashboard event with the following code:

_revealView.SaveDashboard += RevealView_SaveDashboard;

And then implement the event handler:

private async void RevealView_SaveDashboard(object sender, DashboardSaveEventArgs args)
{
    var data = await args.Serialize();
    using (var output = File.OpenWrite($"{args.Name}.rdash"))
    {
        output.Write(data, 0, data.Length);
    }
    args.SaveFinished();
}

The example above shows a simplified implementation for handling the “Save” event. In a real-world scenario you might want to display a custom UI to the user, where he/she can select the location and final name of the dashboard.

In the case that the user changed the name of the dashboard, you can use the method SerializeWithNewName, to get the name reflected properly in the Title attribute for the dashboard.

In case you don’t want to handle the save action, you can turn off the option to edit dashboards by setting:

revealSettings.CanEdit = false;

This might be useful, for example, when your users are not supposed to make changes.