views:

24

answers:

2

I'm trying to make a custom control in Silverlight have the same functionality as a ContentControl, notably being editable in Blend.

The custom control has a property "AdditionalContent" which holds the Content that should be displayed. It is bound to and displayed with a ContentPresenter in the Xaml for the control's UI. Unfortunately, my custom control inherits from a 3rd party control, so inheriting from ContentControl is not an option.

I looked at the Silverlight Toolkit code, at HeaderedContentControl, and used it as guidance to get my "AdditionalContent" property working. The only problem is that it is not friendly to Blend. I'm getting some very basic editability in Blend, but not the smooth integration that Blend has for types of ContentControl or HeaderedContentControl.

Is there any kind of Attribute or something else I can add so Blend knows how to handle this situation? Or is it the case that Blend is hard coded for ContentControl and HeaderedContentControl types?

+1  A: 

Add a [ContentPropertyAttribute] to the control specifying the name of the content element.

Michael S. Scherotter
Works perfectly, thanks!
grimus
A: 

Hello,

And how can we do if we have multiple items to mark ?

Thx by advance !

Jmix90