Answers

There is not way to cast an object to TabItem using DataTemplate-ing as far as I know. You have to do it be code. The converter Michael is using is for the Custom Control to handle threading issues. You will need this (or a similar for that matter) but
you will have to add tab items by code. No way to cast in any way object to TabItem. It's an issue I have read about in silverlight.net in the past but I don't recall (or can retrieve) the specific article to redirect you.
1+1 = 3 for large values of 1

All replies

There is not way to cast an object to TabItem using DataTemplate-ing as far as I know. You have to do it be code. The converter Michael is using is for the Custom Control to handle threading issues. You will need this (or a similar for that matter) but
you will have to add tab items by code. No way to cast in any way object to TabItem. It's an issue I have read about in silverlight.net in the past but I don't recall (or can retrieve) the specific article to redirect you.
1+1 = 3 for large values of 1

If ypu plan to assign the collection as datasource then your datacontext is an IVisualCollection you can run through to collect the items to a list taking under consideration threading issues like Mike's converter demostrates.

I don't know what exactly is the problem but keep in mind you fill the list in a thread this means that you shound expect the list to be returned empty from the ValueConverter but it will be filled afterwards. Check if your IVisualCollection has items
before calling the dispatcher. If it does everyting should be ok. Threading is your problem.

1+1 = 3 for large values of 1

!!! NOTICE: Make sure that in the threaded loop you add your items to an ObservableObjectCollection<TabItem> so that the whole concept works. I neglected to stress this point as Michael's converter demostrates it, but it's imperative
for the whole value converter thing to work. And coming to think of it, this could most probably be your problem as I see that you use a simple list.