# Tuesday, September 11, 2007

More Silverlight exploration.

 

I want to create a user control that has the concept of children that I can add (this.Children.Add()). I see that Panel adds this concept, but that Control is missing it. At the same time, Control provides the InitializeFromXaml helper, which seems to be pretty integral to user controls. Panel and Control are completely disjoint (in terms of inheritance chain), so you cannot nicely merge these two.

 

What are folks expected to do in this situation? Good question. The team is aware of this, and working on a solution. In the meantime, you (and me) will will need to do some hacking to get the control children outcome.

Tuesday, September 11, 2007 10:01:58 PM (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 

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.

 

Tuesday, September 11, 2007 7:16:48 PM (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [2]  |