C
C#3mo ago
Elio

Custom ToggleButon WPF

https://paste.mod.gg/siztgxijeavn/1 Hello, i'm trying to make my own togglebutton because i want it to have the property IscheckedLeft that allow me to easily switch the side of the checked value of my button. I've almost done it but i can't find a way to change my storyboard depends of IscheckedLeft. Basically i would like to Set this if IscheckedLeft = false
<ThicknessAnimation
Storyboard.TargetName="Thumb"
Storyboard.TargetProperty="Margin"
To="0 0 39 0"
Duration="0:0:0.2" />
<ThicknessAnimation
Storyboard.TargetName="Thumb"
Storyboard.TargetProperty="Margin"
To="0 0 39 0"
Duration="0:0:0.2" />
and Set this if IscheckedLeft = true
<ThicknessAnimation
Storyboard.TargetName="Thumb"
Storyboard.TargetProperty="Margin"
To="39 0 0 0"
Duration="0:0:0.2" />
<ThicknessAnimation
Storyboard.TargetName="Thumb"
Storyboard.TargetProperty="Margin"
To="39 0 0 0"
Duration="0:0:0.2" />
My problem there is if i use a converter the following error is triggered "Cannot freeze this Storyboard timeline tree for use across threads". Have you any idea how i could do this ?
0 Replies
No replies yetBe the first to reply to this messageJoin