Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UWP ToggleSwitch put Content on the Left

Tags:

xaml

uwp

Is there an easy way to get the content (text) on the left side of a ToggleSwitch control? (Else than messing up the Template).

Thanks

like image 652
danbord Avatar asked Feb 02 '26 08:02

danbord


1 Answers

You should alter the template if you want to do it correctly.

However, if you want to fix it in a hacky way, change the FlowDirection of the control. But then you'll have to tweak with margins and alignments to make it look decent when used with other controls (see image below for default alignment).

<StackPanel>
    <ToggleSwitch OffContent="Test" OnContent="Test2"></ToggleSwitch>
    <ToggleSwitch OffContent="Test" OnContent="Test2" FlowDirection="RightToLeft"></ToggleSwitch>
</StackPanel>

Flowdirection changed

like image 182
Bart Avatar answered Feb 04 '26 00:02

Bart



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!