# Control Initialization and Document Access

> When the WPF TextControl is ready: the Loaded event, runtime-only members, DocumentLoaded and ContentsReset, opening a file at startup and UI thread access.

- **Product:** TX Text Control .NET for WPF
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Text Control .NET for WPF > Integration Guide > Control Initialization and Document Access
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/integration/initialization/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/integration/initialization/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/integration/initialization/llms-full.txt

---

## On This Page

- [The Lifecycle of the Control](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/integration/initialization/#the-lifecycle-of-the-control)
- [Members That Exist Only at Run Time](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/integration/initialization/#members-that-exist-only-at-run-time)
- [Open a Document When the Window Opens](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/integration/initialization/#open-a-document-when-the-window-opens)
- [Run Startup Code Once](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/integration/initialization/#run-startup-code-once)
- [Access the Document From Code](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/integration/initialization/#access-the-document-from-code)
- [Next Steps](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/integration/initialization/#next-steps)

---

## Nearby

- **Previous:** [Embedding the Editor in Windows and UserControls](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/integration/embedding/llms.txt)
- **Next:** [Data Binding](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/integration/data-binding/llms.txt)
