you are capturing mouse events based on an element. as soon as the mouse moves off the element, you stop receiving these events. this is fine for down click, but for the move you want the window or bounding element. for up you need to use the window to always capture.
you will need to define blazor callbacks for the mouse events:
just add the javascript:
window.addEventListener("mouseup", (e) => DotNet.invokeMethodAsync(assName,"MouseUp",e.x,e.y);
window.addEventListener("mousemove", (e) => DotNet.invokeMethodAsync(assName,"MouseMove",e.x,e.y);
I also question updating the style in the after render. this just sets the values used in the next render operation. you were forced to call it during render. just rename the method as it is not an after render operation. after render is used to access the true dom after the component render typically via js interop.