# Tuesday, September 11, 2007
« Sharing Code Between Silverlight and Orc... | Main | Silverlight User Controls and this.Child... »

I had a strange (and not particularly pleasant) morning today, so I quickly decided as I entered my office that I wouldn't be doing any work this morning. Time to open VS and kick on Silverlight a bit more.

I'm thinking that the task for the morning is to write a fancy Image subclass. Sit down, new SL project, add a user control and add ": Image" to my class declaration. Turns out that doesn't work. Huh?

I open up the object browser, and System.Windows.Controls.Image is 'sealed'. Ouch! You have to subclass Control, or MediaBase. This isn't the experience that I was looking for. Hmm. Answer: Send mail ...

From: Richard Lander
Sent: Tuesday, September 11, 2007 10:50 AM
To: Rich's Buddies in Jolt team
Subject: Image is sealed. Why?

 

I was noticing that all the end-point classes (Image, Textblock, …) are sealed. What’s the thinking on that? It definitely inhibits the developer experience.

 

rich

I'm still waiting back on the final answer, but I'm guessing (and hoping) that this is issue is a bug. It has to be.

I also noticed someone else running into a variant of this issue.

I'll keep on pusing on this one.

 

Wednesday, September 12, 2007 1:46:20 AM (GMT Daylight Time, UTC+01:00)
I have had the exact same experience far (far) too many times. However, my problems generally stem from the FCL in general. All too often critical classes are sealed and offer no common interfaces to implement. For years I reported the issues to Microsoft, but was always told that it was by default (usually so that the JITer could make some optimizations; sounds like the JITer should be improved rather than blindly sealing the classes). Now I do not report them anymore. As much as I like the FCL, it has caused me a great deal of inconvenience and unnecessary workarounds.

Lately I've been doing work with the Eclipse (Java) libraries. The class abstraction and interfaces are truly amazing. Just about anything is overridable with very little fuss. Microsoft could really learn a lot from Eclipse (and I mean that in a positive, constructive way).
Craig Martins
Sunday, September 23, 2007 4:18:24 PM (GMT Daylight Time, UTC+01:00)
I think it is by design at the moment. You need to go the wrapper way :) Or try using extension methods.
Comments are closed.