locked
Toggle Switch behaviour from Windows 8.1 for a Windows 8 App?

    Question

  • I have a running Windows 8.1 app in Visual Studio Express 2013. I'm currently porting it to Windows 8 (with a parallel install of Visual Studio 2012). So far, so good. When adopting the Settings Flyout I ran into a weird problem.

    For the Windows 8.1 I'm using a standard SettingsFlyout with white background and a Toggle Switch:

    <ToggleSwitch x:Name="Tabletop" Margin="-6, -25, 0, 0" Toggled="Tabletop_Toggled"/>

    This works just fine in Windows 8.1. For Windows 8 I did a user control that imitates the Settings Flayout. Again, with white Background. But When I put the Toggle Swith there using the same line and setting Foreground to "Black", only the Text appears black. The Switch itself is white and therefore invisible. Not sure if this is due to the behaviour of the Toggle Switch itself or something the Settings Flyout in Windows 8.1 does. Anyway. The question is: How do I get the Toggle Switch to appear? Any ideas?

    Monday, March 24, 2014 12:53 PM

Answers

  • I have a running Windows 8.1 app in Visual Studio Express 2013. I'm currently porting it to Windows 8 (with a parallel install of Visual Studio 2012). So far, so good. When adopting the Settings Flyout I ran into a weird problem.

    For the Windows 8.1 I'm using a standard SettingsFlyout with white background and a Toggle Switch:

    <ToggleSwitch x:Name="Tabletop" Margin="-6, -25, 0, 0" Toggled="Tabletop_Toggled"/>

    This works just fine in Windows 8.1. For Windows 8 I did a user control that imitates the Settings Flayout. Again, with white Background. But When I put the Toggle Swith there using the same line and setting Foreground to "Black", only the Text appears black. The Switch itself is white and therefore invisible. Not sure if this is due to the behaviour of the Toggle Switch itself or something the Settings Flyout in Windows 8.1 does. Anyway. The question is: How do I get the Toggle Switch to appear? Any ideas?

    You'd need to edit the template, as shown here:

    http://msdn.microsoft.com/en-us/library/windows/apps/jj709931.aspx

    • Marked as answer by Raymond AT Monday, March 24, 2014 5:58 PM
    Monday, March 24, 2014 2:23 PM

All replies

  • I have a running Windows 8.1 app in Visual Studio Express 2013. I'm currently porting it to Windows 8 (with a parallel install of Visual Studio 2012). So far, so good. When adopting the Settings Flyout I ran into a weird problem.

    For the Windows 8.1 I'm using a standard SettingsFlyout with white background and a Toggle Switch:

    <ToggleSwitch x:Name="Tabletop" Margin="-6, -25, 0, 0" Toggled="Tabletop_Toggled"/>

    This works just fine in Windows 8.1. For Windows 8 I did a user control that imitates the Settings Flayout. Again, with white Background. But When I put the Toggle Swith there using the same line and setting Foreground to "Black", only the Text appears black. The Switch itself is white and therefore invisible. Not sure if this is due to the behaviour of the Toggle Switch itself or something the Settings Flyout in Windows 8.1 does. Anyway. The question is: How do I get the Toggle Switch to appear? Any ideas?

    You'd need to edit the template, as shown here:

    http://msdn.microsoft.com/en-us/library/windows/apps/jj709931.aspx

    • Marked as answer by Raymond AT Monday, March 24, 2014 5:58 PM
    Monday, March 24, 2014 2:23 PM
  • Thanks a lot, that worked perfectly for me.
    Monday, March 24, 2014 5:59 PM