1

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.

Community
  • 1
  • 1
Ian
  • 33,605
  • 26
  • 118
  • 198

1 Answers1

1

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

WPF-it
  • 19,625
  • 8
  • 55
  • 71
  • Inital reaction is wow... you can do a lot through WPF and triggers if you know what you're doing. I think I might give it a try. The thing I'm unsure about is whether or not I'll be able to produce the graph (I need some historical values which I think I'll have to store in code? unless I can add a single point to a Geometry Line or similar on each update). – Ian May 16 '12 at 14:27
  • Ok.. lets make it a combined project... Keep posted about your doubts here and I will assist you. :-) – WPF-it May 16 '12 at 14:28
  • If you're interested in helping how about assisting with the project? It's only a small one and I can completely implement the progress bar via code behind, and you could help me translate to an improved solution using more Xaml? We could discuss via email? I don't really want to form a long set of questions here as it doesn't keep within the ethos for the site. – Ian May 17 '12 at 12:02
  • You can create a CodePlex workspace for both of us ... Use your windows live id (hotmail/msn) to login and access this link... http://codeplex.codeplex.com/wikipage?title=CodePlex%20FAQ#Create. – WPF-it May 17 '12 at 12:46
  • I will do hopefully next week sometime. I struggle getting access to remote source control so I'll see if I can finish off the C# version, and then I'll put it up so you can help port to a XAML based equivalent. Watch this space... – Ian May 18 '12 at 12:22
  • Had an idea as I have source control issue. I'm going to create a StackOverflow chat room and provide a link to the source thus far if that's alright with you? Then I can ask questions in more of a chatty way which isn't really appropriate normally. – Ian May 24 '12 at 12:07
  • sure. You can do whats convenient for both of us. Make sure that the download host is trustable such as stackoverflow / Codeproject / codeplex ... (otherwise my company firewall would block it) – WPF-it May 24 '12 at 13:25
  • I've created a room "WPF (Code->XAML)" - "Discussion between Ian @ AngelWPF to help translate codebehind to XAML". Feel free to join it. Can you download from a dropbox link? If not I can probably post enough code in the chat or use something like pastebin – Ian May 25 '12 at 08:03
  • Hey Ian... cant access this link... :-( ... Blocked by my enterprise firewall ... can we you update the project (attach zip copy) on other website such as Codeproject? – WPF-it May 25 '12 at 10:26
  • Really? That's just the stackoverflow chat area for asking questions... that's bit of a pain :/ got an email address? I can then relay the information somewhere on SO for any others who might find the exercise useful... – Ian May 25 '12 at 11:58
  • Hey Ian... external emails are also forbidden and blocked on my enterprise email... especially source code zip files... (yes they scan it!!!)... Codeproject is my best choice honestly... – WPF-it May 25 '12 at 13:12
  • Unfortunately our firewall policy means I can't connect to codeplex to upload any source code. May just have to give up on the idea if you can't access SO chat. – Ian May 28 '12 at 13:38
  • Codeplex and Codeproject are different websites... can you check codeproject and let me know.... – WPF-it May 29 '12 at 08:38
  • The link in the answer is broken! Any idea where to get the information now? – GreenEyedAndy Sep 04 '15 at 12:01
  • you could google. One link is on SO itself `'http://stackoverflow.com/questions/6505222/change-old-wpf-progressbar-controltemplate-to-wpf4` – WPF-it Sep 07 '15 at 04:33