oh. i just thought of another way to avoid the need 2 converters.
you could use the ConverterParameter and pass through a flag to
dictate the behaviour. eg one image could have ConverterParameter=1
and the other ConverterParameter=0. then in your converter you
could flip the behaviour depending on what is supplied
Visibility="{Binding IsToggled,Converter={StaticResource
specialConverter},ConverterParameter=1}"
then use the "object parameter" param in your converter.
On Fri, 19 Mar 2010 10:44:46 +0530 wrote
>Getting late on a Friday and the client asked if the togglebuttons (which
have icons as content) could change to a different icon whentoggled.Thought of
3 ways to do it:1.Override the template, have two images, set opacity inthe
visual state storyboard Checked/UnChecked. Tonnes of XAML...2.Create a custom
control ContentToggleButton that takestwo sets of content, one for Check, one
for Unchecked, switch them on statechange. Tonnes of Time...3.(Assuming your
binding) Add two images to thetogglebutton and bind their visibility to the
same property using avisibilityConverter and of course a quickly hacked up
Inverted converter!<ToggleButton Grid.Column="1" Style="{StaticResource
ToggleButtonStyle}"HorizontalAlignment="Left"
DataContext="{BindingBindsDirectlyToSource=True}" IsChecked="{Binding
Path=Selected, Mode=TwoWay}">_______________________________________________
ozsilverlight mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight