How can i cast into a ObservableCollection<object>
you should copy like this
return new ObservableCollection<object>(myTabItemObservableCollection);
Basically, you can't. Not now, and not in .NET 4.0.
What is the context here? What do you need? LINQ has Cast<T>
which can get you the data as a sequence, or there are some tricks with generic methods (i.e. Foo<T>(ObservalbleCollection<T> col)
etc).
Or you can just use the non-generic IList
?
IList untyped = myTypedCollection;
untyped.Add(someRandomObject); // hope it works...
you could use IEnumerable.Cast<T>()