Jak ustawić trigger w wpf dla checkBox, aby działała animacja od Slider Menu

0

Witam, robię pierwszy raz porządniejszy widok w WPF i mam mały problem, z slideMenu, nie wiem czemu, jak pierwszy checkBox kliknę to działa w sensie wysuwa się menu, jak kliknę na drugi, aby schowało się menu, to również działa, ale już nie mogę ponownie go rozwinąć, tylko jak klikam na 2 checkBox, to widać animację chowania. W klasie, jak to popodpinałem i zrobiłem tą samą logikę co mam w triggerach poniżej to działa wszystko ok, a bardzo potrzebuje, aby to właśnie działało na tych trigerach w xaml.

Za wszelką pomoc z góry dziękuję.

  <Trigger SourceName="CheckBoxOpenMenu" Property="IsChecked" Value="false">
                <Trigger.EnterActions>
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="GridMenu">
                                <EasingDoubleKeyFrame KeyTime="0" Value="400"/>
                                <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="40"/>
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </BeginStoryboard>
                </Trigger.EnterActions>
            </Trigger>

            <Trigger SourceName="CheckBoxOpenMenu" Property="IsChecked" Value="true">  
                <Trigger.EnterActions>
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="GridMenu">
                                <EasingDoubleKeyFrame KeyTime="0" Value="40"/>
                                <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="400"/>
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </BeginStoryboard>
                </Trigger.EnterActions>
            </Trigger>
        </ControlTemplate.Triggers>-->
1

Spróbuj dodać Trigger.ExitActions

<Trigger SourceName="CheckBoxOpenMenu" Property="IsChecked" Value="false">
                <Trigger.EnterActions>
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="GridMenu">
                                <EasingDoubleKeyFrame KeyTime="0" Value="400"/>
                                <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="40"/>
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </BeginStoryboard>
                </Trigger.EnterActions>
                <Trigger.ExitActions>
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="GridMenu">
                                <EasingDoubleKeyFrame KeyTime="0" Value="40"/>
                                <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="400"/>
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </BeginStoryboard>
                </Trigger.EnterActions>
            </Trigger>

            <Trigger SourceName="CheckBoxOpenMenu" Property="IsChecked" Value="true">  
                <Trigger.EnterActions>
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="GridMenu">
                                <EasingDoubleKeyFrame KeyTime="0" Value="40"/>
                                <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="400"/>
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </BeginStoryboard>
                </Trigger.EnterActions>
                <Trigger.ExitActions>
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="GridMenu">
                                <EasingDoubleKeyFrame KeyTime="0" Value="400"/>
                                <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="40"/>
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </BeginStoryboard>
                </Trigger.EnterActions>
            </Trigger>
        </ControlTemplate.Triggers>-->

1 użytkowników online, w tym zalogowanych: 0, gości: 1