HeaderedContentControl sample

Here is a handy control(HeaderedContentcontrol) for silverlight, Attached is the sample code and usage
this by no means is professional quality(change extension from .doc to .zip)


6 thoughts on “HeaderedContentControl sample

  1. Hi,
    I tried this control with the final/release version of Silverlight 2 and It seems that it’s not working any more.
    The “Page.xaml” shows a completely blank screen, no matter if it’s in design time or in run-time.
    Does anyone now what changes do we need to do to maket it work?

  2. There is HeaderedContentControl in the silverlight toolkit released by microsoft. I would say using that might be better as that will be more inline with standard way of writing control. it comes with source also.

    as this was written well before RTW, there will be quite a few changes that have to be made

    let me know if you still want this to work.

  3. Yes, I found the HeaderedContentControl in the silverlight toolkit and it does what I needed, but I’d still like to have this control working to compare and understand what changes need to be made in situations like this. You see, the thing is that I downloaded other user controls that were somewhat similar to this one and I had the same kind of problems (a completely blank screen).
    Do you have a link to MS Documentation that explains the kind of changes one has to make to convert UserControls that are using ContentControls? Or could you make a list of these changes yourself?

  4. here are the changes
    1.Add a constructor
    public HeaderedContentControl()
    DefaultStyleKey = typeof(HeaderedContentControl);

    2.change the Dependency properties signature(last argument changed to null)
    public static readonly DependencyProperty HasHeaderProperty =
    DependencyProperty.Register(“HasHeader”, typeof(bool), typeof(HeaderedContentControl),null);

    3.create a folder called “Themes” and move generic.xaml into that, replace ContentPresenter in generic.xaml to ContentControl

  5. Great!

    It worked!

    In fact it worked even without having to replace the ContentPresenter by ContentControl. Do you think that one should replace it anyway?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s