Esempio n. 1
0
        private void ButtonClose_Click(object sender, RoutedEventArgs e)
        {
            Storyboard storyboard = new Storyboard();

            DoubleAnimation daWidth = new DoubleAnimation(SideMenu.ActualWidth, 0, new Duration(TimeSpan.FromSeconds(0.4)));

            storyboard.Children.Add(daWidth);

            Storyboard.SetTarget(daWidth, SideMenu);
            Storyboard.SetTargetProperty(daWidth, new PropertyPath(WidthProperty));

            SideMenu.BeginStoryboard(storyboard);
        }