If you comment out the last line, the red rectangle will mostly stay synched with the mouse when the mouse is moving in the canvas with its right button down. With the last line in, the slack is considerable and very noticeable.

I did some instrumentation in the empty Rendering handler. It’s being called 100 times every 800-1000 milliseconds (one update per ~8-10 milliseconds, computed in chunks of 100). If I replace CompositionTarget.Rendering with DispatchTimer set at 10 milliseconds interval, then mouse tracking is much better (the mouse pointer will stay inside the rectangle) but the Tick handler is only being called once per ~15 milliseconds.

It gets worse:

I just tried running an animation..say spinning the rectangle while it is moving. It seems like the animation has the same effect as CompositionTarget.Rendering, so…if I want to keep the rectangle in synch with the mouse, you have to not do any animations, yikes! Actually, you could do some animation using a dispatch timer, as long as its cranking along at one update per 15 milliseconds, the rectangle will still spin and the mouse pointer will stay inside the rectangle boundaries.