WorkflowView.SaveViewState(Stream) Method

Definition

Saves the view-state to a binary stream.

C#
public void SaveViewState(System.IO.Stream viewState);

Parameters

viewState
Stream

A BinaryReader used to store the view state.

Examples

The following example demonstrates saving the view state for a WorkflowView object by creating a FileStream object using the FileMode.Create flag and passing it to the SaveViewState method. To load this view state at a later time, see LoadViewState.

C#
public void SaveViewState()
{
    using (FileStream fs = new FileStream(@"viewstate.bin", FileMode.Create))
    {
        this.workflowView.SaveViewState(fs);
    }
}

Remarks

View state is the accumulation of the values of the properties and child controls of a view. Property values are persisted to the stream after saving and can be restored using the LoadViewState method.

Applies to

Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1