Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
wieslawsoltes authored Jan 29, 2024
1 parent 80a53b3 commit b40e3cd
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,41 @@ Install-Package Avalonia.Svg.Skia
<Image Source="{SvgImage /Assets/__AJ_Digital_Camera.svg}"/>
```

### CSS styling

```XAML
<Svg Path="/Assets/__tiger.svg"
Css=".Black { fill: #FF0000; }" />
```

```XAML
<Style Selector="Svg">
<Setter Property="(Svg.Css)" Value=".Black { fill: #FF0000; }" />
</Style>
```

```XAML
<SvgSource x:Key="TigerIcon"
Path="/Assets/__tiger.svg"
Css=".Black { fill: #FF0000; }" />
```

```XAML
<Image>
<Image.Source>
<SvgImage Source="{DynamicResource TigerIcon}" />
</Image.Source>
</Image>
```

```XAML
<Image>
<Image.Source>
<SvgImage Source="/Assets/__tiger.svg" Value=".Black { fill: #FF0000; }" />
</Image.Source>
</Image>
```

#### Avalonia Previewer

To make controls work with `Avalonia Previewer` please add the following lines to `BuildAvaloniaApp()` method:
Expand Down

0 comments on commit b40e3cd

Please sign in to comment.