# ChartFrame.AddUndoUnit Method

> Add the current state of the chart which is connected with this ChartFrame to the undo stack. Programmatic changes performed with the chart's properties and methods are not automatically added to a TextControl's undo stack. Calling this method is not necessary, when the chart frame's layout in the text is changed.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 18.0
- **Namespace:** `TXTextControl.DataVisualization`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl.DataVisualization > ChartFrame.AddUndoUnit Method
- **289 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/chartframe/addundounit-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/chartframe/addundounit-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/chartframe/addundounit-method/llms-full.txt

---

### Description

Add the current state of the chart which is connected with this ChartFrame to the undo stack. Programmatic changes performed with the chart's properties and methods are not automatically added to a TextControl's undo stack. Calling this method is not necessary, when the chart frame's layout in the text is changed.

### Syntax

```csharp
public void AddUndoUnit();
```

```vbnet
Public Sub AddUndoUnit()
```

### Examples

The following example adds the current chart frame change to the undo history. The created object is then available to the surrounding document workflow.

```csharp
chartFrame.AddUndoUnit();
Console.WriteLine("Chart Frame is ready for use.");
```

```vbnet
chartFrame.AddUndoUnit()
Console.WriteLine("Chart Frame is ready for use.")
```

---

## Nearby

- **Previous:** [ChartFrame Class](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/chartframe/llms-full.txt)
- **Next:** [ChartFrame.Chart Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/chartframe/chart-property/llms-full.txt)
