Storyboard applied to a dashboard c# mvvm uwp

Javier R 211 Reputation points
2022-11-05T18:25:53.097+00:00

I have this code to open and close Panel with StoryBoard how I can implement it in the ViewModel. c# UWP

 public void OpenAndClose()  
        {  
            if(SlidePanel.Translate)  
            {  
                ShowPanel.Begin();  
            }  
  
            if(SlidePanel.TranslateX == 0)  
            {  
                HidePanel.Begin();  
            }  
        }  
Universal Windows Platform (UWP)
{count} votes

1 answer

Sort by: Most helpful
  1. Nico 106 Reputation points
    2022-11-11T05:49:30.117+00:00

    Hi, Welcome to Microsoft QA

    The better way is that create a such IsOpen Dependency property for your side-panel, then binding it with a bool property where in the viewmodel, when you update this bool poperty, it will start different animation. For checking the samilar solution please refer to this case reply

    Thanks
    vzhumin