This project is read-only.

Error in ContentTabView when tab titles are controls and not just strings

Aug 25, 2010 at 1:38 AM

Hi Josh (adajos),

Your control is excellent.  Thanks for the effort!

I just thought I would point out that there is a little bug when you assign the "titles" to the ImageButtons on the ContentTabView.  You have the line

imageButton.Title = title;

I recommend at very least changing it to:

imageButton.Title = title.ToString(); 

Otherwise, whatever UserControl title was, it ends up being the child of two parents - causing some dodgy behaviour...  If you ToString it, it at least gives the same text as in the dropdown.


Thanks again for the code.  I will put a link-back to it from once I have finished testing it in my application :-)


The code in a bit more context from ContentTabView.xaml.cs


object title = null ;
if (_views.TryGetValue(view, out title))
	imageButton.Title = title.ToString();










Aug 25, 2010 at 2:44 PM

Hey Jimme,

I agree completely with your point.  I will try to get that into a changeset ASAP.  Glad you are enjoying FabTab!



Sep 21, 2010 at 8:13 PM

Hi Jimme,

I just thought I'd give you an update.  I committed your suggested change, and you can pull it down in the latest changeset.  The change was made actually made in the ImageButtonFactory class because of some earlier refactoring.

Incidentally if you have a look at the CancelCloseEventWindow.xaml in the SampleProject I show an example of how to made the Header be more than just a string.  Basically the Header itself is still a string, the key is to set the HeaderTemplate to something with other graphical elements.

I hope that helps.