Avalonia: Add support for setting Pen properties from Xaml

Created on 4 Jul 2019  路  1Comment  路  Source: AvaloniaUI/Avalonia

Repro:

<GeometryDrawing x:Key="Bulb" Brush="#75FF0000" Geometry="M0 0L60 0L60 60L0 60L0 0Z">
    <GeometryDrawing.Pen>
        <Pen Brush="#FFFF0000" Thickness="8" LineCap="Round" LineJoin="Round" MiterLimit="10"/>
    </GeometryDrawing.Pen>
</GeometryDrawing>

Error:

Error       Unable to find suitable setter or adder for property Brush of type Avalonia.Visuals:Avalonia.Media.Pen for argument System.Private.CoreLib:System.String, available setter parameter lists are:
 (line 10 position 30) Line 10, position 30.    RenderDemo  C:\DOWNLOADS\GitHub-Forks\Avalonia\samples\RenderDemo\Pages\DrawingPage.xaml    10  
API

Most helpful comment

Ah yes, Pen is currently an immutable object. We need to make it mutable.

>All comments

Ah yes, Pen is currently an immutable object. We need to make it mutable.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stdcall picture stdcall  路  4Comments

akunchev picture akunchev  路  3Comments

danwalmsley picture danwalmsley  路  4Comments

MarchingCube picture MarchingCube  路  4Comments

TheColonel2688 picture TheColonel2688  路  3Comments