public ShaderTabControl()
 {
     InitializeComponent();
     _selectionchanged = true;
     _randomgenerator  = new Random();
     _roundcorner      = (Style)(this.FindResource("RoundCorners"));
     _openanims        = new Storyboard[]
     {
         WpfHelpers.FindStoryBoard(this, "PopupSlideLeftIn"),
         WpfHelpers.FindStoryBoard(this, "PopupSlideRightIn"),
         WpfHelpers.FindStoryBoard(this, "PopupSlideTopIn"),
         WpfHelpers.FindStoryBoard(this, "PopupSlideBottomIn")
     };
     _closeanims = new Storyboard[]
     {
         WpfHelpers.FindStoryBoard(this, "PopupSlideLeftOut"),
         WpfHelpers.FindStoryBoard(this, "PopupSlideRightOut"),
         WpfHelpers.FindStoryBoard(this, "PopupSlideTopOut"),
         WpfHelpers.FindStoryBoard(this, "PopupSlideBottomOut")
     };
     _closeanims[0].Completed += PopupClose_Completed;
     _closeanims[1].Completed += PopupClose_Completed;
     _closeanims[2].Completed += PopupClose_Completed;
     _closeanims[3].Completed += PopupClose_Completed;
 }
Beispiel #2
0
        private void SetColor()
        {
            Storyboard sb;
            ColorAnimationUsingKeyFrames anim;
            EasingColorKeyFrame          frame;

            sb = WpfHelpers.FindStoryBoard(this, "In");
            for (int i = 2; i < 4; i++)
            {
                anim        = (ColorAnimationUsingKeyFrames)sb.Children[i];
                frame       = (EasingColorKeyFrame)anim.KeyFrames[1];
                frame.Value = SystemColors.HotTrackBrush.Color;
            }

            for (int i = 2; i < 4; i++)
            {
                sb          = WpfHelpers.FindStoryBoard(this, "Out");
                anim        = (ColorAnimationUsingKeyFrames)sb.Children[i];
                frame       = (EasingColorKeyFrame)anim.KeyFrames[0];
                frame.Value = SystemColors.HotTrackBrush.Color;
            }
        }
 private void ResetAnimation()
 {
     WpfHelpers.FindStoryBoard(this, "Reset").Begin();
 }
Beispiel #4
0
        private void RenderItems(Toolcat Category, string searchtext = null, bool noanim = false)
        {
            if (!_loaded)
            {
                return;
            }
            View.Children.Clear();
            List <ToolBase> list;

            if (!string.IsNullOrEmpty(searchtext))
            {
                list = (from i in _tools where i.Description.ToLower().Contains(searchtext.ToLower()) orderby i.Description ascending select i).ToList();
                RenderList(list);
                return;
            }

            if (!noanim)
            {
                WpfHelpers.FindStoryBoard(this, "Change").Begin();
            }
            int counter = 0;

            switch (Category)
            {
            case Toolcat.All:
                list        = (from i in _tools orderby i.Description ascending select i).ToList();
                counter    += RenderList(list);
                Header.Text = string.Format("Tools ({0})", counter);
                break;

            case Toolcat.Favorites:
                var items = (from i in _tools where App._Config.UsageStats.ContainsKey(i.Description) orderby App._Config.UsageStats[i.Description] descending select i);
                counter    += RenderList(items.ToList());
                counter    += RenderBooks("**fav**");
                Header.Text = string.Format("Most used ({0})", counter);
                break;

            case Toolcat.Analog:
                list        = (from i in _tools where i.Category == ToolCategory.Analog orderby i.Description ascending select i).ToList();
                counter    += RenderList(list);
                Header.Text = string.Format("Analog Tools ({0})", counter);
                break;

            case Toolcat.Digital:
                list        = (from i in _tools where i.Category == ToolCategory.Digital orderby i.Description ascending select i).ToList();
                counter    += RenderList(list);
                Header.Text = string.Format("Digital Tools ({0})", counter);
                break;

            case Toolcat.Other:
                list        = (from i in _tools where i.Category == ToolCategory.Other orderby i.Description ascending select i).ToList();
                counter    += RenderList(list);
                Header.Text = string.Format("Other Tools ({0})", counter);
                break;

            case Toolcat.Web:
                list        = (from i in _tools where i.Category == ToolCategory.Web orderby i.Description ascending select i).ToList();
                counter    += RenderList(list);
                Header.Text = string.Format("Web Tools ({0})", counter);
                break;

            case Toolcat.External:
                list        = (from i in _tools where i.Category == ToolCategory.External orderby i.Description ascending select i).ToList();
                counter    += RenderList(list);
                Header.Text = string.Format("External Programs ({0})", counter);
                break;

            case Toolcat.Books:
                counter    += RenderBooks();
                Header.Text = string.Format("Books ({0})", counter);
                break;
            }
        }