In an effort to teach myself more about WPF, I'm trying to build a simple application. Where I work we have some hardware that has a bank of 8 dip switches used for setting an address from 0 to 255 (as an 8-bit number). It's a simple concept that I would like to build into a WPF windows application that would allow users to see the dip switch settings for a given address. I built a similar app in WinForms that would simply show/hide pictures of dip switches. I'd like to port it to WPF and do something more elegant.
I've done some simple databinding with strings and numbers, making them show up in labels, and I've done some introductory work with user controls.
What I would like to do is create a user control that mimics a single dip switch, which would have a "State" property that would be a boolean true or false. I could then place 8 of them in my window and tie them to my code.
In the XAML, I would have a drawing of the dip switch, and the sliding part would move to the on or off position depending on the true/false value of the State property. Once I figure that out, maybe I could animate it later.
At this point I'm looking for a conceptual overview... how would I create this property in a user control, and have it's value affect the position of the graphical switch?
Thanks.