Skip to content

Commit

Permalink
add eventcallback for imageLoaded
Browse files Browse the repository at this point in the history
  • Loading branch information
florian03-1 committed Mar 30, 2024
1 parent bfa6af9 commit 49c1b9f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions BlazorSvgEditor.SvgEditor/SvgEditor.Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public partial class SvgEditor
[Parameter] public EventCallback<(Coord<double> translate, double scale)> TranslationChanged { get; set; }
private async Task InvokeTranslationChanged() => await TranslationChanged.InvokeAsync((Translate, Scale));

[Parameter] public EventCallback OnImageLoaded { get; set; } //Event for image loaded

//ReadOnly
[Parameter] public bool ReadOnly { get; set; } = false; //Is the editor read only?

Expand Down
1 change: 1 addition & 0 deletions BlazorSvgEditor.SvgEditor/SvgEditor.PublicMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ public async Task ReloadImage()
}

_imageSourceLoading = false;
await OnImageLoaded.InvokeAsync();
StateHasChanged();
}

Expand Down
2 changes: 1 addition & 1 deletion BlazorSvgEditor.WasmTest/Pages/Preview.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public partial class Preview
{
private SvgEditor? svgEditor;
private int SelectedShapeId { get; set; }
private bool ReadOnly { get; set; } = false;
private bool ReadOnly { get; set; } = true;


private List<Shape> Shapes = new();
Expand Down

0 comments on commit 49c1b9f

Please sign in to comment.