Skip to content

CodeView

Class in Oadm.Sdk.Client.Controls · Oadm.Sdk.Client.dll

The one read-only code display (response bodies, headers): monospace, selectable and copyable, no line wrapping (horizontal scrolling), JSON and XML pretty-printed with 2 spaces and highlighted, param.cgi key=value text highlighted (keys, values, “# Error” lines). CodeView.Language Auto detects the language from CodeView.ContentType and the text. Text that does not parse is shown exactly as it is; texts above CodeView.HighlightLimit characters are shown without colors. Colors are the theme brushes Oadm.Code.KeyBrush, StringBrush, NumberBrush, LiteralBrush, PunctuationBrush, TagBrush, AttributeBrush, CommentBrush, ErrorBrush; the look comes from the theme style ui|CodeView. Editable code is CodeEditor (same colors).

public sealed class CodeView : Border

Inherits Border

Set them in XAML (<ui:CodeView Name="..." />) or bind them.

Name Type Description
ContentType string? HTTP content type of CodeView.Text, used by CodeLanguage.Auto.
HighlightLimit int Texts longer than this many characters are shown without colors.
IsFormatted bool True (default): JSON and XML are re-indented. False: the text is shown exactly as given (still highlighted).
Language CodeLanguage How to read the text; Auto decides from the content type, then from the text.
Text string? The text to show (e.g. the response body).
string DisplayedText { get; }

The shown text; select all and copy goes through the inner SelectableTextBlock (Ctrl+C, context menu).

CodeDocument Document { get; private set; }

What is shown right now (text, language used, tokens).