Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to customise wp7 toolkit ToggleSwitch

I have the WP7 toolkit and am using the toggle switch.

At the moment it displays On or Off.

I know you can customise it using the the content template and the sample code supplied with the tookit shows just that, but it I can't find a way of changine On/Off to something else.

I want to display Yes and No.

like image 827
Steve Chadbourne Avatar asked Oct 22 '10 01:10

Steve Chadbourne


1 Answers

I created my own value converter that was bound to the same boolean property on my view model as IsChecked. So on the view it looked like:

<toolkit:ToggleSwtich IsChecked="{Binding Completed}" Content="{Binding Completed, Converter={StaticResource YesNoConverter}" />
like image 178
Nigel Sampson Avatar answered Oct 08 '22 00:10

Nigel Sampson