Skip to content

How to customise style List

whistyun edited this page Dec 5, 2020 · 1 revision

Abstract

In Markdown.Avalonia, List is rendered used by Grid control which has 'List' class. And list mark is CTextBLock which has 'ListMaker'

liststrc

Example

style

<!--
    xmlns="https://github.com/avaloniaui"
    xmlns:ctxt="clr-namespace:ColorTextBlock.Avalonia;assembly=ColorTextBlock.Avalonia"
-->
<Style Selector="Grid.List">
    <Setter Property="Background" Value="Gray"/>
</Style>

<Style Selector=".List ctxt|CTextBlock">
    <Setter Property="Margin" Value="7"/>
    <Setter Property="Background" Value="AliceBlue"/>
    <Setter Property="FontSize" Value="28"/>
</Style>

<Style Selector="ctxt|CTextBlock.ListMarker">
    <Setter Property="Margin" Value="7"/>
    <Setter Property="Background" Value="Red"/>
</Style>

markdown

list example

* listitem1
* listitem2

view

view