← ClaudeAtlas

using-wpf-clipboardlisted

Uses WPF Clipboard for copy/paste operations with text, images, and custom data formats. Use when implementing copy/paste functionality or inter-application data transfer.
christian289/dotnet-with-claudecode · ★ 41 · Data & Documents · score 73
Install: claude install-skill christian289/dotnet-with-claudecode
# WPF Clipboard Patterns Implementing copy/paste functionality using the Windows clipboard. **Advanced Patterns:** See [ADVANCED.md](ADVANCED.md) for clipboard monitoring and error handling. ## 1. Clipboard Overview ``` Clipboard Operations ├── Text Operations │ ├── SetText / GetText │ └── Unicode, RTF, HTML support ├── Image Operations │ ├── SetImage / GetImage │ └── BitmapSource support ├── File Operations │ ├── SetFileDropList / GetFileDropList │ └── File path collection └── Custom Data ├── SetData / GetData └── DataObject with multiple formats ``` --- ## 2. Text Operations ### 2.1 Basic Text Copy/Paste ```csharp using System.Windows; // Copy text to clipboard Clipboard.SetText("Hello, World!"); // Paste text from clipboard if (Clipboard.ContainsText()) { var text = Clipboard.GetText(); // Use text } ``` ### 2.2 Text Formats ```csharp // Set text with specific format Clipboard.SetText("Hello", TextDataFormat.UnicodeText); Clipboard.SetText("<b>Hello</b>", TextDataFormat.Html); Clipboard.SetText(@"{\rtf1 Hello}", TextDataFormat.Rtf); // Get text with specific format if (Clipboard.ContainsText(TextDataFormat.Html)) { var html = Clipboard.GetText(TextDataFormat.Html); } ``` **TextDataFormat Options:** | Value | Description | |-------|-------------| | **Text** | ANSI text | | **UnicodeText** | Unicode text (default) | | **Rtf** | Rich Text Format | | **Html** | HTML format | | **CommaSeparatedValue** | CSV format | --- ## 3. Imag