I have a series of nested components like this:
LocationDetails
NodeWithChildren
NodeDetails
PhotoGallery (shows images of current node)
PhotoGalleryZoom (modal dialog)
ImageEditor
The NodeWithDetails
component renders out a list of child elements. It also renders a PhotoGallery
for the current node, which displays 0 or more images.
When an image is clicked the PhotoGalleryZoom
is presented. This is basically a modal window with the ImageEditor
embedded. The ImageEditor
has delete, rotate and crop tools.
While the Image editor takes care of sending edits to the server, I need to update the matching, existing, image on the page underneath. Preferably not by doing an entire page refresh. The URL of the image does not change, so I basically need to refresh the IMG element.
Any thoughts on the best (simple) way to communicate a change to a trivial item like an image in a disparate component? The image rendering is very basic ATM:
<img src="@($"{ImageBase}{imageId}")?size=4" />
In a jQuery equivalent website I built previously, I was able to simply match IMG element by a data ID on them, but looking for the "best" Blazor way to do the same. Thanks.