Пример #1
0
        public Anchors(Grid grid)
        {
            InitializeComponent();
            close.Click += (sender, e) => grid.Children.Remove(this);

            res = new Dictionary <Span, Image>
            {
                { y, iy },
                { y1, iy1 },
                { y2, iy2 },
                { yk, iyk }
            };

            imageAnimation                = new DoubleAnimation();
            imageAnimation.From           = 1;
            imageAnimation.To             = 0;
            imageAnimation.Duration       = TimeSpan.FromSeconds(0.8);
            imageAnimation.RepeatBehavior = RepeatBehavior.Forever;
            imageAnimation.AutoReverse    = true;

            image_grid.MouseDown += (ss, ee) =>
            {
                if (Grid.GetRow(image_grid) == 1)
                {
                    Base.IncreaseImage(image_grid, 3, 5);
                }
                else
                {
                    Base.ReduceImage(image_grid, 1, 1);
                }
            };
        }
        public TextOrImage(Grid grid1, string data, bool istext = true, Dictionary <string, object> tooltips = null, int size = 20, bool stretch = false)
        {
            InitializeComponent();
            close.Click += (sender, e) => grid1.Children.Remove(this);
            if (istext)
            {
                scroll.Visibility = Visibility.Visible;
                TextBlock s = Helpers.GetFormattedText(data, size, tooltips);
                content.Inlines.Add(s);
            }
            else
            {
                image.Source          = new BitmapImage(new Uri(@"pack://siteoforigin:,,,/Sections/" + data));
                image_grid.MouseDown += (ss, ee) =>
                {
                    if (Grid.GetRow(image_grid) == 1)
                    {
                        Base.IncreaseImage(image_grid, 3, 3);
                    }
                    else
                    {
                        Base.ReduceImage(image_grid, 1, 1);
                    }
                };

                if (stretch)
                {
                    grid.ColumnDefinitions[0].Width = new GridLength(1.3, GridUnitType.Star);
                    grid.ColumnDefinitions[1].Width = new GridLength(4, GridUnitType.Star);
                    grid.ColumnDefinitions[2].Width = new GridLength(2, GridUnitType.Star);
                    list.Stretch  = System.Windows.Media.Stretch.Fill;
                    image.Stretch = System.Windows.Media.Stretch.Fill;
                }
            }
        }
        public TextWithImage(Grid grid1, string text, string img, Dictionary <string, object> tooltips = null, int size = 20, bool stretch = false)
        {
            InitializeComponent();
            close.Click          += (sender, e) => grid1.Children.Remove(this);
            image.Source          = new BitmapImage(new Uri(@"pack://siteoforigin:,,,/Sections/" + img));
            image_grid.MouseDown += (ss, ee) =>
            {
                if (Grid.GetRow(image_grid) == 1)
                {
                    Base.IncreaseImage(image_grid, 3, 5);
                }
                else
                {
                    Base.ReduceImage(image_grid, 1, 1);
                }
            };

            TextBlock s = Helpers.GetFormattedText(text, size, tooltips);

            content.Inlines.Add(s);
            if (stretch)
            {
                grid.ColumnDefinitions[0].Width = new GridLength(0.2, GridUnitType.Star);
                int count = grid.ColumnDefinitions.Count;
                grid.ColumnDefinitions[count - 1].Width = new GridLength(50);
                notebook.Stretch          = System.Windows.Media.Stretch.Fill;
                close.HorizontalAlignment = HorizontalAlignment.Right;
            }
        }
Пример #4
0
        public Collector(Grid grid)
        {
            InitializeComponent();
            close.Click += (sender, e) => grid.Children.Remove(this);

            image_grid.MouseDown += (ss, ee) =>
            {
                if (Grid.GetRow(image_grid) == 1)
                {
                    Base.IncreaseImage(image_grid, 3, 5);
                }
                else
                {
                    Base.ReduceImage(image_grid, 1, 1);
                }
            };
        }
Пример #5
0
        public Item8(Grid grid)
        {
            InitializeComponent();
            close.Click += (sender, e) => grid.Children.Remove(this);
            link.Click  += (sender, e) => grid.Children.Add(new TextWithImage(grid, Base.ReadFile(prefix + "text.txt"), prefix + "image.jpg"));

            image_grid.MouseDown += (ss, ee) =>
            {
                if (Grid.GetRow(image_grid) == 1)
                {
                    Base.IncreaseImage(image_grid, 3, 5);
                }
                else
                {
                    Base.ReduceImage(image_grid, 1, 1);
                }
            };
        }
Пример #6
0
        public Item14(Grid grid)
        {
            InitializeComponent();
            close.Click += (sender, e) => grid.Children.Remove(this);
            link.Click  += (s, e) =>
            {
                string str = System.IO.Directory.GetCurrentDirectory() + "\\Sections\\";
                System.Diagnostics.Process.Start(str + "1_1/1_1_2/16/flash.swf");
            };

            image_grid.MouseDown += (ss, ee) =>
            {
                if (Grid.GetRow(image_grid) == 1)
                {
                    Base.IncreaseImage(image_grid, 3, 5);
                }
                else
                {
                    Base.ReduceImage(image_grid, 1, 1);
                }
            };
        }