Conversation
Further edits on RichTextEditor control doc. Add new Troubleshooting doc.
Further edits to main reference and troubleshooting pages. Add paths to sidebar. Add samples to Samples and Tutorials page.
| ## Performance checklist | ||
|
|
||
| - Batch all multi-edit operations | ||
| - Use `UpdateFinished` instead of `Changed` for expensive operations | ||
| - Debounce user-triggered updates | ||
| - Set appropriate `UndoLimit` on the editor | ||
| - Disable undo during bulk loads | ||
| - Use background threads for serialization | ||
| - Minimize pointer allocations | ||
| - Profile before optimizing |
There was a problem hiding this comment.
This could work better placed earlier in the document, perhaps after "Core performance characteristics"?
| ## Debugging threading issues | ||
|
|
||
| ### Enable thread assertions | ||
|
|
||
| Avalonia has built-in thread checking: | ||
|
|
||
| ```csharp | ||
| // Throws if not on UI thread | ||
| Dispatcher.UIThread.VerifyAccess(); | ||
| ``` | ||
|
|
||
| ### Common exceptions | ||
|
|
||
| **InvalidOperationException**: "The calling thread cannot access this object because a different thread owns it." | ||
| - **Cause**: Accessing UI thread object from background thread | ||
| - **Fix**: Use `Dispatcher.UIThread.InvokeAsync()` | ||
|
|
||
| **NullReferenceException** when accessing `Element` | ||
| - **Cause**: Weak reference collected or background thread access | ||
| - **Fix**: Check null and ensure UI thread |
There was a problem hiding this comment.
Would this make more sense on the Troubleshooting page?
| | `MarkdownCodeBlockParagraphPadding` | Thickness | `16` | — | Inner padding | | ||
| | `MarkdownCodeBlockParagraphBorderThickness` | Thickness | `1` | — | Border thickness | | ||
| | `MarkdownCodeBlockParagraphCornerRadius` | CornerRadius | `6` | — | Corner radius | |
There was a problem hiding this comment.
Does this mean the default dark setting is the same as default light, or that no default is defined for dark mode?
| | `MarkdownQuoteBlockSectionBorderThickness` | Thickness | `4,0,0,0` | — | Quote block left border thickness | | ||
| | `MarkdownQuoteBlockSectionBorderBrush` | Brush | `#DDDDDD` | `#3b434b` | Quote block border brush | | ||
| | `MarkdownQuoteBlockSectionForeground` | Brush | `#777777` | `#8b949e` | Quote block foreground color | | ||
| | `MarkdownQuoteBlockSectionPadding` | Thickness | `15,0` | — | Quote block inner padding | | ||
| | `MarkdownQuoteBlockFirstChildSectionMargin` | Thickness | `0,0,0,14` | — | Margin for first child in quote | | ||
| | `MarkdownQuoteBlockLastChildSectionMargin` | Thickness | `0` | — | Margin for last child in quote | |
There was a problem hiding this comment.
Same as the above table. Would be nice to clarify whether Thickness properties in dark mode share the light mode defaults, or actually have no defaults.
| | `MarkdownTableBorderThickness` | Thickness | `0,0,1,1` | — | Table outer border thickness | | ||
| | `MarkdownTableCellSpacing` | Double | `0` | — | Cell spacing | | ||
| | `MarkdownTableCellBorderThickness` | Thickness | `1,1,0,0` | — | Cell border thickness | | ||
| | `MarkdownTableCellParagraphPadding` | Thickness | `12,5` | — | Cell paragraph padding | |
There was a problem hiding this comment.
Same comment as previous re: dark mode defaults.
| | `MarkdownAlertBlockWarningParagraphForeground` | Brush | `#9a6700` | `#d29922` | Warning alert paragraph foreground | | ||
| | `MarkdownAlertBlockCautionBorderBrush` | Brush | `#d1242f` | `#f85149` | Caution alert border brush | | ||
| | `MarkdownAlertBlockCautionParagraphForeground` | Brush | `#d1242f` | `#f85149` | Caution alert paragraph foreground | | ||
| | `MarkdownAlertBlockHeaderMargin` | Thickness | `0 0 0 8` | — | Alert header margin | |
There was a problem hiding this comment.
Same comment as previous re: dark mode defaults.
Currently WIP
This PR adds new documentation for the RichTextEditor.
Avalonia.Controls.RichTextEditorto available packages listed on the Accelerate installation page.