Esempio n. 1
0
        private static void NoisePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            OuterGlowBitmapEffect target = ((OuterGlowBitmapEffect)d);


            target.PropertyChanged(NoiseProperty);
        }
Esempio n. 2
0
        private void DrawICONSONPAGE(int pageNO)
        {
            Canvas WorkingCanvas;
            //Odd PageNUmber
            if (pageNO % 2 == 1)
            {
                WorkingCanvas = C1;
                WorkingCanvas.Children.Clear();
                myeffects.Fade(C1, SliderTargetPos.front, Drtn_fade);
                myeffects.Fade(C0, SliderTargetPos.left, Drtn_fade);
                C0.Children.Clear();
            }
            //Even PageNumber
            else
            {

                WorkingCanvas = C0;
                WorkingCanvas.Children.Clear();
                myeffects.Fade(C1, SliderTargetPos.left,Drtn_fade);
                myeffects.Fade(C0, SliderTargetPos.front, Drtn_fade);
                C1.Children.Clear();
            }

            Image oldpage = (Image)pager.FindName("Page" + CurrentPage.ToString());
            if(oldpage!=null)
            myeffects.VisiblityAnimation(oldpage, false);
            //WorkingCanvas.Children.Clear();
            int count = 0;
            CurrentPage = pageNO;
            TotalIconPerPage = Math.Ceiling(TotalIconPerPage);

            for (int i = CurrentPage *(int) TotalIconPerPage; i < (CurrentPage + 1) * TotalIconPerPage && i < ICONALL.Length; i++)
            {
                ShellObject sfd;
                ShellFile sf;
                Image img = new Image();
                img.Stretch = Stretch.Uniform;
                if (ICONALL[i].Image == "")
                {
                        sfd = ShellObject.FromParsingName(ICONALL[i].Path);
                        if (Iconsize > 98)
                            img.Source = sfd.Thumbnail.ExtraLargeBitmapSource;
                        else if (Iconsize > 70)
                            img.Source = sfd.Thumbnail.LargeBitmapSource;
                        else
                            img.Source = sfd.Thumbnail.MediumBitmapSource;
                }
                else
                    img.Source=ThemeManager.imageSourceGnrator(Environment.CurrentDirectory+"\\Icons\\"+ICONALL[i].Image,Pathtype.path);

                StackPanel stack = new StackPanel();

                if (workbench.FindName("ICON" + i.ToString() + "P" + PanalID.ToString()) != null)
                {
                    workbench.UnregisterName("ICON" + i.ToString() + "P" + PanalID.ToString());
                }
                stack.Name = "ICON" + i.ToString() + "P" + PanalID.ToString();
                workbench.RegisterName("ICON" + i.ToString() + "P" + PanalID.ToString(), stack);
                stack.ContextMenu = IconOption;

                stack.MouseEnter += new MouseEventHandler(stack_MouseEnter);
                stack.MouseLeave += new MouseEventHandler(stack_MouseLeave);
                stack.MouseLeftButtonDown += new MouseButtonEventHandler(stack_MouseLeftButtonDown);

                stack.HorizontalAlignment = HorizontalAlignment.Left;
                stack.VerticalAlignment = VerticalAlignment.Top;
                Label lb = new Label();
                lb.HorizontalAlignment = HorizontalAlignment.Center;
                lb.VerticalAlignment = VerticalAlignment.Center;
                img.Margin = new Thickness(0, 9, 0, 0);

                OuterGlowBitmapEffect outer = new OuterGlowBitmapEffect();
                outer.GlowColor = Color.FromRgb(255, 255, 255);
                OuterGlowBitmapEffect outer2 = new OuterGlowBitmapEffect();
                outer2.GlowColor = Color.FromRgb(255, 255, 255);
                outer2.GlowSize = 7;
                outer2.Opacity = .5;
                stack.Margin = marginGenrator(count);
                DropShadowEffect Shadow = new DropShadowEffect();
                Shadow.Color = Color.FromRgb(0, 0, 0);
                Shadow.ShadowDepth = 3.3;
                Shadow.BlurRadius = 3.9;
                Shadow.Opacity = .7;

                outer.GlowSize = 9;
                outer.Opacity = .3;

                string s = DetailStruct.TrimToLegnth(ICONALL[i].Path,14);
                img.VerticalAlignment = VerticalAlignment.Center;

                img.Height = Iconsize;
                img.Width = Iconsize;
                lb.Content = s;
                lb.Effect = Shadow;
                lb.Margin = new Thickness(0, -4, 0, 0);
                lb.Foreground = Brushes.White;
                stack.Width = StackWidth;
                stack.Height = StackHeight;

                #region Handover to Main Widows
                stack.Children.Add(img);
                stack.Children.Add(lb);
                WorkingCanvas .Children.Add(stack);
                #endregion
                count++;
                //animateMouseInFade(oldpage, 0);

            }
        }