コード例 #1
0
        private void MouseLeaveMenu(object sender, MouseEventArgs e)
        {
            DoubleAnimation animation = new DoubleAnimation();

            animation.From     = 1;
            animation.To       = 0;
            animation.Duration = new Duration(TimeSpan.FromMilliseconds(50));
            RectangleMenu.BeginAnimation(OpacityProperty, animation);
        }
コード例 #2
0
ファイル: WinAdmin.xaml.cs プロジェクト: Melmoez/Prime-Legal
        private void BtnCloseMenu_Click(object sender, RoutedEventArgs e)
        {
            BtnOpenMenu.Visibility  = Visibility.Visible;
            BtnCloseMenu.Visibility = Visibility.Collapsed;

            DoubleAnimation GridMenuClose = new DoubleAnimation();
            DoubleAnimation LineMenuClose = new DoubleAnimation();

            GridMenuClose.From     = GridHamburger.ActualWidth;
            LineMenuClose.From     = RectangleMenu.ActualWidth;
            GridMenuClose.To       = 70;
            LineMenuClose.To       = 47;
            LineMenuClose.Duration = TimeSpan.FromSeconds(0.1);
            GridMenuClose.Duration = TimeSpan.FromSeconds(0.1);
            RectangleMenu.BeginAnimation(Rectangle.WidthProperty, LineMenuClose);
            GridHamburger.BeginAnimation(Grid.WidthProperty, GridMenuClose);
        }