示例#1
0
        /// <summary>
        /// Handles changes to the ImagePath property.
        /// </summary>
        /// <param name="d">ImageIcon</param>
        /// <param name="e">DependencyProperty changed event arguments</param>
        private static void OnImagePathChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ImageIcon icon         = (ImageIcon)d;
            string    oldImagePath = (string)e.OldValue;
            string    newImagePath = icon.ImagePath;

            icon.OnImagePathChanged(oldImagePath, newImagePath);
        }
        void FluidWrapPanelDemo_Loaded(object sender, RoutedEventArgs e)
        {
            ImageIcon imgIcon;

            imgIcon = new ImageIcon()
            {
                Width = 65, Height = 65, ImagePath = "/Resources/Images/Icons/Applications.png"
            };
            source1.Add(imgIcon);
            imgIcon = new ImageIcon()
            {
                Width = 65, Height = 65, ImagePath = "/Resources/Images/Icons/browser.png"
            };
            source1.Add(imgIcon);
            imgIcon = new ImageIcon()
            {
                Width = 65, Height = 65, ImagePath = "/Resources/Images/Icons/cal.png"
            };
            source1.Add(imgIcon);
            imgIcon = new ImageIcon()
            {
                Width = 65, Height = 65, ImagePath = "/Resources/Images/Icons/calc.png"
            };
            source1.Add(imgIcon);
            imgIcon = new ImageIcon()
            {
                Width = 65, Height = 65, ImagePath = "/Resources/Images/Icons/clock.png"
            };
            source1.Add(imgIcon);
            imgIcon = new ImageIcon()
            {
                Width = 65, Height = 65, ImagePath = "/Resources/Images/Icons/Downloads.png"
            };
            source1.Add(imgIcon);
            imgIcon = new ImageIcon()
            {
                Width = 65, Height = 65, ImagePath = "/Resources/Images/Icons/Facebook.png"
            };
            source1.Add(imgIcon);
            imgIcon = new ImageIcon()
            {
                Width = 65, Height = 65, ImagePath = "/Resources/Images/Icons/graph.png"
            };
            source1.Add(imgIcon);
            imgIcon = new ImageIcon()
            {
                Width = 65, Height = 65, ImagePath = "/Resources/Images/Icons/ipod.png"
            };
            source1.Add(imgIcon);
            imgIcon = new ImageIcon()
            {
                Width = 65, Height = 65, ImagePath = "/Resources/Images/Icons/mail.png"
            };
            source1.Add(imgIcon);
            imgIcon = new ImageIcon()
            {
                Width = 65, Height = 65, ImagePath = "/Resources/Images/Icons/map.png"
            };
            source1.Add(imgIcon);
            imgIcon = new ImageIcon()
            {
                Width = 65, Height = 65, ImagePath = "/Resources/Images/Icons/notes.png"
            };
            source1.Add(imgIcon);
            imgIcon = new ImageIcon()
            {
                Width = 65, Height = 65, ImagePath = "/Resources/Images/Icons/phone.png"
            };
            source1.Add(imgIcon);
            imgIcon = new ImageIcon()
            {
                Width = 65, Height = 65, ImagePath = "/Resources/Images/Icons/photo.png"
            };
            source1.Add(imgIcon);
            imgIcon = new ImageIcon()
            {
                Width = 65, Height = 65, ImagePath = "/Resources/Images/Icons/Skype.png"
            };
            source1.Add(imgIcon);
            imgIcon = new ImageIcon()
            {
                Width = 65, Height = 65, ImagePath = "/Resources/Images/Icons/SMS.png"
            };
            source1.Add(imgIcon);
            imgIcon = new ImageIcon()
            {
                Width = 65, Height = 65, ImagePath = "/Resources/Images/Icons/Terminal.png"
            };
            source1.Add(imgIcon);
            imgIcon = new ImageIcon()
            {
                Width = 65, Height = 65, ImagePath = "/Resources/Images/Icons/tools.png"
            };
            source1.Add(imgIcon);
            imgIcon = new ImageIcon()
            {
                Width = 65, Height = 65, ImagePath = "/Resources/Images/Icons/twitter.png"
            };
            source1.Add(imgIcon);
            imgIcon = new ImageIcon()
            {
                Width = 65, Height = 65, ImagePath = "/Resources/Images/Icons/wallpaper.png"
            };
            source1.Add(imgIcon);
            imgIcon = new ImageIcon()
            {
                Width = 65, Height = 65, ImagePath = "/Resources/Images/Icons/weather.png"
            };
            source1.Add(imgIcon);

            fluidWrapPanel.ItemsSource = source1;
        }