BlazorExtensions/Canvas

[FIX] [Add-Commit] Attributes

nurbat opened this issue · 1 comments

IN BECanvasComponent

Remove:

[Parameter]
public long Height { get; set; }

[Parameter]
public long Width { get; set; }

Add:

[Parameter(CaptureUnmatchedValues = true)]
public Dictionary<string, object> InputAttributes { get; set; }

IN BECanvas.razor

Remove:
<canvas id="@Id" width="@Width" height="@Height" @ref="_canvasRef"></canvas>

Add:
<canvas id="@Id" @attributes="InputAttributes" @ref="_canvasRef"></canvas>

Finish, use:

<BECanvas style="height: 250px; flex: auto" @ref="_canvasReference" ></BECanvas >
<BECanvas Height="@SizeY" Width="@SizeX" @ref="_canvasReference" />

I have created PR #119 that does exactly as you described.