How to implement animation in mvvm wpf applications?

Viewed 29

In wpf applications, animation is implemented like this: A trigger is created, for example EventTrigger , it calls events from the element code (which negates the mvvm architectural pattern), and then a soma animation is created.

<ComboBox.Triggers>
    <EventTrigger RoutedEvent="ChangeSelectedItems">
        <BeginStoryboard>
            <Storyboard>
                <DoubleAnimation Storyboard.TargetName="AnimeList"
                        Storyboard.TargetProperty="Height"
                                 From="0" To="280"
                                 Duration="0:0:0:3"/>
            </Storyboard>
        </BeginStoryboard>
    </EventTrigger>
</ComboBox.Triggers>

Based on this, the question is how to create an event for the animation call and not break mvvm, while it should be exactly its own event, and not a built-in one? Foreshadowing the question why not built-in, because firstly, I could not find events on the ComboBox, and secondly, they will not be able to implement the functionality that is needed.

0 Answers
Related