-
Notifications
You must be signed in to change notification settings - Fork 26
How to customise style CCode
whistyun edited this page Dec 26, 2020
·
1 revision
In Markdown.Avalonia, CCode is used for inline code.
For now code block is displaied by TextBlock.CodeBlock
.
<Style Selector="Border.CodeBlock">
<Style.Setters>
<Setter Property="BorderBrush" Value="Blue"/>
<Setter Property="BorderThickness" Value="0,5,0,5"/>
<Setter Property="Margin" Value="5,0,5,0"/>
<Setter Property="Background" Value="LightBlue"/>
</Style.Setters>
</Style>
<Style Selector="TextBlock.CodeBlock">
<Style.Setters>
<Setter Property="Foreground" Value="DarkBlue"/>
<Setter Property="FontFamily" Value="Meiryo"/>
</Style.Setters>
</Style>
<Style Selector="ctxt|CCode">
<Style.Setters>
<Setter Property="BorderBrush" Value="Green"/>
<Setter Property="BorderThickness" Value="2"/>
<Setter Property="Padding" Value="2"/>
<Setter Property="MonospaceFontFamily" Value="Meiryo" />
<Setter Property="Foreground" Value="DarkGreen" />
<Setter Property="Background" Value="LightGreen" />
</Style.Setters>
</Style>
inline code: `this is inline.`
```c
#include <stdio.h>
int main()
{
// printf() displays the string inside quotation
printf("Hello, World!");
return 0;
}
```
- Foreground
- Background
-
FontFamily: It's not work correctly. - FontWeight
- FontSize
- FontStyle
- BorderThickness
- BorderBrushProperty
- CornerRadiusProperty
- BoxShadowProperty
- PaddingProperty
- MarginProperty
-
IsUnderline
If true is set, draw line under the text.
-
IsStrikethrough
If true is set, draw strikethrough in the text.
-
MonospaceFontFamily
In CCode, this is treat as FontFamily.