Ian
Ian

Reputation: 34489

Should I use a ContentControl or Template?

I'm trying to create my own custom progress bar in WPF (to recreate Windows 8 Progress Bars). I decided to try and stick to standard patterns as much as possible so I thought it best to inherit from the RangeBase control. I started following a guide on extending RangeBase by using Templates.

The problem I've got however is that I intend to have some code behind (mainly for rendering a graph) and I don't believe I can do this via a template. Is this correct?

Would the best practise be to switch over to using a ContentControl and implementing a similar interface to the RangeBase? Or is there something else I could do.

Upvotes: 1

Views: 545

Answers (1)

Vinit Sankhe
Vinit Sankhe

Reputation: 19885

Why should you have difficulty overriding the RangeBase's control template and implement your own look and feel?

This link below has a Thermometer implementation by giving a cool control template for a WPF progressbar (and thus range base)

http://msdn.microsoft.com/en-us/magazine/cc163497.aspx

Upvotes: 1

Related Questions