コード例 #1
0
        private void OK_Click(object sender, RoutedEventArgs e)
        {
            if (ItemsColl.Children.Count > 0)
            {
                gallery.ClearGallery();
                foreach (StackPanel stp in ItemsColl.Children)
                {
                    gallery.AddGalleryImage(new GalleryImage(((TextBox)stp.Children[1]).Text, stp.Tag.ToString()));
                }

                gallery.Tag = null;

                gallery.LoadImageSources(data);
                gallery.RefreshAndUpdate();
            }
            else
            {
                gallery.Tag = "D";
                gallery.ClearGallery();
                gallery.AddGalleryImage(new Class.Controls.GalleryImage(Strings.ResStrings.Text, ""), new BitmapImage(new Uri("pack://application:,,,/Resources/Background/SelectModelBackground.jpg")));
                gallery.AddGalleryImage(new Class.Controls.GalleryImage(Strings.ResStrings.Text, ""), new BitmapImage(new Uri("pack://application:,,,/Resources/Background/BackgroundMat.jpg")));
                gallery.AddGalleryImage(new Class.Controls.GalleryImage(Strings.ResStrings.Text, ""), new BitmapImage(new Uri("pack://application:,,,/Resources/Background/ImgBackground.jpg")));
                gallery.RefreshAndUpdate();
            }
            Close();
        }