Source code for Style of Sliding ToggleButton in WPF

by Parvez 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.

Sliding 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 :)

Tags Tags: , , , , ,

 
 


    Posts    Tag Cloud


Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.



Copyright Parvez Ansari © 2013. All rights reserved

Proudly powered by BlogEngine.NET 1.6.1.0