# DrawingCollection Class

> An instance of the DrawingCollection class contains all drawings in a document represented through objects of the type DataVisualization.DrawingFrame. An instance of this class can be obtained with the TextControl.Drawings, WPF.TextControl.Drawings or ServerTextControl.Drawings property. The DrawingCollection class implements the IEnumerable and the ICollection interfaces.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Class
- **Introduced:** 23.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
- **Inherits:** `TXTextControl.FrameBaseCollection`
- **Implements:** `System.Collections.ICollection`, `System.Collections.IEnumerable`
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl.DataVisualization > DrawingCollection Class
- **1164 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/drawingcollection/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/drawingcollection/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/drawingcollection/llms-full.txt

---

### Description

An instance of the DrawingCollection class contains all drawings in a document represented through objects of the type [DataVisualization.DrawingFrame](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/drawingframe/llms-full.txt). An instance of this class can be obtained with the [TextControl.Drawings](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/drawings-property/llms-full.txt), [WPF.TextControl.Drawings](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/drawings-property/llms-full.txt) or [ServerTextControl.Drawings](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/servertextcontrol/drawings-property/llms-full.txt) property. The DrawingCollection class implements the IEnumerable and the ICollection interfaces.

### Syntax

```csharp
public class DrawingCollection : FrameBaseCollection
```

```vbnet
Public Class DrawingCollection
    Inherits FrameBaseCollection
```

### Examples

The following example includes the count value from a Drawing Collection object in application diagnostics. The created object is then available to the surrounding document workflow.

```csharp
Console.WriteLine($"Count: {drawingCollection.Count}");
Console.WriteLine("Drawing Collection is ready for use.");
```

```vbnet
Console.WriteLine($"Count: {drawingCollection.Count}")
Console.WriteLine("Drawing Collection is ready for use.")
```

---

## In This Section

- [DrawingCollection.Add Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/drawingcollection/add-method/llms-full.txt): Inserts a new drawing in a Text Control document.
- [DrawingCollection.CopyTo Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/drawingcollection/copyto-method/llms-full.txt): Copies the elements of the collection to an array, starting at a particular index.
- [DrawingCollection.DeactivateItem Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/drawingcollection/deactivateitem-method/llms-full.txt): Deactivates the activated drawing and sets the input focus back to the text part that contains the drawing.
- [DrawingCollection.GetActivatedItem Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/drawingcollection/getactivateditem-method/llms-full.txt): Returns the currently activated drawing. An activated drawing has the input focus and can be edited. The method returns null, if no drawing is activated.
- [DrawingCollection.GetItem Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/drawingcollection/getitem-method/llms-full.txt): Gets a particular drawing from the collection.
- [DrawingCollection.Remove Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/drawingcollection/remove-method/llms-full.txt): Removes a drawing from a Text Control document.

---

## Nearby

- **Previous:** [ChartFrame.SaveMode Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/chartframe/savemode-property/llms-full.txt)
- **Next:** [DrawingCollection.Add Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/drawingcollection/add-method/llms-full.txt)
