2. December 2010 13:52
The power of WPF that allows you to change the look and behavior of the control has always amazed me and I simply love working with Styles and Templates in WPF.
I have made a ToggleButton which has cool sliding effect. When the ToggleButton is checked on the sliding element moves to right showing “ON” state written and when you check it off it shows the “OFF” state written and the sliding element moves back to the left.
Below image shows you how the control looks in ToggleOn and ToggleOff State. You can change the color of the sliding element by simply changing the background color of the ToggleButton.
The downloadable project contains the Resource dictionary which has the source code for the style of the sliding ToggleButton.
You can download the project from the WPFBlogger CodePlex Page.
Happy Styling :)