Thank you for your update.
We have prepared a sample to achieve your requirement and you can download the sample from the attached file.
In this sample, we have modified the NewButtonTemplate as you have required which contains the Stackpanel and Borders. Also we have hooked the NewButtonClick event to add the TabItemExt at runtime.
Please let us know in case of any queries.