diff --git a/BlazorSvgEditor.SvgEditor/SvgEditor.Main.cs b/BlazorSvgEditor.SvgEditor/SvgEditor.Main.cs index 503d13c..f866a6b 100644 --- a/BlazorSvgEditor.SvgEditor/SvgEditor.Main.cs +++ b/BlazorSvgEditor.SvgEditor/SvgEditor.Main.cs @@ -47,6 +47,8 @@ public partial class SvgEditor [Parameter] public EventCallback<(Coord 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? diff --git a/BlazorSvgEditor.SvgEditor/SvgEditor.PublicMethods.cs b/BlazorSvgEditor.SvgEditor/SvgEditor.PublicMethods.cs index 2948ab3..7f5daf1 100644 --- a/BlazorSvgEditor.SvgEditor/SvgEditor.PublicMethods.cs +++ b/BlazorSvgEditor.SvgEditor/SvgEditor.PublicMethods.cs @@ -148,6 +148,7 @@ public async Task ReloadImage() } _imageSourceLoading = false; + await OnImageLoaded.InvokeAsync(); StateHasChanged(); } diff --git a/BlazorSvgEditor.WasmTest/Pages/Preview.razor.cs b/BlazorSvgEditor.WasmTest/Pages/Preview.razor.cs index cb3754a..02bbd16 100644 --- a/BlazorSvgEditor.WasmTest/Pages/Preview.razor.cs +++ b/BlazorSvgEditor.WasmTest/Pages/Preview.razor.cs @@ -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 Shapes = new();