Пример #1
0
        private static void NavBarText_MouseLeave(object sender, MouseEventArgs e, NavBarLeftSide navBar, Grid grid, ProgressBar progressBar)
        {
            Duration        duration        = new Duration(TimeSpan.FromMilliseconds(300));
            DoubleAnimation doubleanimation = new DoubleAnimation(progressBar.Value - 100, duration);

            progressBar.BeginAnimation(ProgressBar.ValueProperty, doubleanimation);
        }
Пример #2
0
        public static void MoveActivIndicator(NavBarLeftSide navBar, Grid grid)
        {
            Duration           duration = new Duration(TimeSpan.FromMilliseconds(200));
            ThicknessAnimation move     = new ThicknessAnimation(new Thickness(navBar.activeWindow.Margin.Left, navBar.activeWindow.Margin.Top, 0, 0), new Thickness(navBar.activeWindow.Margin.Left, grid.Margin.Top + 11, 0, 0), duration);

            navBar.activeWindow.BeginAnimation(Border.MarginProperty, move);
        }
Пример #3
0
        public static NavBarLeftSide CreateNavBar(MainWindow window)
        {
            NavBarLeftSide navBar   = new NavBarLeftSide(window);
            List <Grid>    blocks   = new List <Grid>();
            Grid           prefGrid = new Grid();
            Dictionary <Grid, ProgressBar> refDict = new Dictionary <Grid, ProgressBar>()
            {
                { navBar.dashboardGrid, navBar.dashboardBar },
                { navBar.homeGrid, navBar.homeBar },
                { navBar.favGrid, navBar.favBar },
                { navBar.hgamesGrid, navBar.gamesBar },
                { navBar.notificationsGrid, navBar.notificationsBar },
                { navBar.accountGrid, navBar.accountBar },
                { navBar.settingsGrid, navBar.settingsBar },
                { navBar.updateFeedGrid, navBar.updateFeedBar }
            };

            //Bug fix deswegen 2 mal
            navBar.activeWindow.Background  = DoujinUtility.MainWindow.animatedBrush;
            navBar.activeWindow.BorderBrush = DoujinUtility.MainWindow.animatedBrush;
            navBar.Height = 2000;
            navBar.HorizontalAlignment = HorizontalAlignment.Left;
            navBar.VerticalAlignment   = VerticalAlignment.Top;
            navBar.Name = "navBar";
            navBar.RegisterName(navBar.Name, navBar);
            prefGrid.Margin = new Thickness(0, -54, 0, 0);
            if (alwaysMaxed == false)
            {
                navBar.Width       = 52;
                navBar.MouseEnter += delegate(object sender, MouseEventArgs e) { NavBar_MouseEnter(sender, e, navBar); };
                navBar.MouseLeave += delegate(object sender, MouseEventArgs e) { NavBar_MouseLeave(sender, e, navBar); };
            }
            else
            {
                navBar.Width = 280;
            }
            foreach (Grid obj in navBar.rootGrid.Children.OfType <Grid>())
            {
                DoujinUtility.FindChild <ProgressBar>(obj, null).Foreground = DoujinUtility.MainWindow.animatedBrush;


                blocks.Add(obj);
            }
            foreach (Grid grid in blocks)
            {
                navBar.Width     = 52;
                grid.MouseEnter += delegate(object sender, MouseEventArgs e) { NavBarText_MouseEnter(sender, e, navBar, grid, refDict[grid]); };
                grid.MouseLeave += delegate(object sender, MouseEventArgs e) { NavBarText_MouseLeave(sender, e, navBar, grid, refDict[grid]); };
                grid.Margin      = new Thickness(grid.Margin.Left, (prefGrid.Margin.Top + grid.Height + 11), grid.Margin.Right, grid.Margin.Bottom);
                Console.WriteLine(prefGrid.Margin.Top);
                prefGrid = grid;
            }
            return(navBar);
        }
Пример #4
0
 private static void NavBar_MouseEnter(object sender, MouseEventArgs e, NavBarLeftSide navBar)
 {
     if (alwaysMaxed == false)
     {
         navBar.Width = 52;
         DoubleAnimation getThicc = new DoubleAnimation();
         getThicc.From     = 52;
         getThicc.To       = 280;
         getThicc.Duration = new Duration(TimeSpan.FromMilliseconds(200));
         Storyboard.SetTargetName(getThicc, navBar.Name);
         Storyboard.SetTargetProperty(getThicc, new PropertyPath(Window.WidthProperty));
         Storyboard sb1 = new Storyboard();
         sb1.Children.Add(getThicc);
         sb1.Begin(navBar);
     }
     else
     {
         navBar.Width = 280;
     }
 }
Пример #5
0
 private static void NavBar_MouseLeave(object sender, MouseEventArgs e, NavBarLeftSide navBar)
 {
     if (alwaysMaxed == false)
     {
         //throw new System.ArgumentException("f**k");
         DoubleAnimation getSmoll = new DoubleAnimation();
         getSmoll.From     = navBar.Width;
         getSmoll.To       = 52;
         getSmoll.Duration = new Duration(TimeSpan.FromMilliseconds(200));
         Storyboard.SetTargetName(getSmoll, navBar.Name);
         Storyboard.SetTargetProperty(getSmoll, new PropertyPath(Window.WidthProperty));
         Storyboard sb1 = new Storyboard();
         sb1.Children.Add(getSmoll);
         sb1.Begin(navBar);
     }
     else
     {
         navBar.Width = 280;
     }
 }