How to create new gadget on screen?

I am asking the question as an extreme modder of original version.

I already figured out how to mod UI and I made my own UI, I mean just relocating and resizing default buttons, bars etc.

My question is:

How can we add a new gadget / button to the screen?

I tried to create new grids, buttons etc in uimainnew_legacy.xaml file but i couldnt make it work so far. Moreover i realized something. Each grid has got a parameter called “x:Name”, and the name is usually a gadget name which are in old xml files. I tried to do the same thing too, but again didnt work though.