How to Rename the TabItems of the XamTabControl runtime like Excel

John Doe / Thursday, October 1, 2009

Excel-like renaming of the Sheets is a cool feature on a TabControl.

You can implement this with the XamTabControl really fast and easy. Here are the steps how to do this:

1. Retemplate the TabItemEx element and replace the ContentPresenter with a XamTextEditor. The XamTextEditor is handy in this scenario as it has cancelable events which will prevent the editor in entering edit mode if the user is single-clicking. It will only enter edit mode if the user double-clicks.

2. EditModeStarting event and cancel it if it is a Single click action.

You can find the project in the attachments of this blog post.

 

RenamingTabItems.zip