2
Vote

Exception adding ToggleSwitch to Grid in Blend4

description

If I try to create a ToggleSwitch in Blend4 using V1.1 by clicking on the control in the toolbar and then placing in in a container I'm getting an exception:
 
Argument Exception: 'Auto, 0, Auto, 0' is not a valid value for property Margin.
 
But pasting in a completely filled out ToggleSwitch from the sample application into my WPF app works fine.

comments

sarat12 wrote Jan 9, 2013 at 11:47 AM

same issue

wrote Feb 14, 2013 at 7:28 PM

wrote Oct 29, 2013 at 4:48 PM

Arteny wrote Oct 29, 2013 at 4:49 PM

Same error if adding foloowing code to xaml:
    <wpfSpark:ToggleSwitch>

John_Vance wrote Feb 25, 2014 at 7:17 AM

Same issue in VS 2013 Designer and Blend for VS 2013. Explicitly setting Margin on the ToggleSwitch does not help. Setting margin on every element does not help.

John_Vance wrote Feb 25, 2014 at 8:39 AM

Looks like you need to set a width on the control
<WPFSpark:ToggleSwitch Width="50"/>