Drag corners to resize UI elements. Like in the scene view or on a application in windows

Hello all.

I am wanting to create some resizing handles on each corner of a UI element that you would click and drag to resize the window at runtime. Just like on a Windows application, and how you do with UI elements in the scene view.

I understand the basic principles of using the inherited drag and drop functionality but I am struggling to come up with an idea how manipulating the rect transform in such a way.

I have searched for a long while on you tube google and nothing close to what I need have I found. So any suggestions would greatly appreciated!