Пример #1
0
        public void AddWallpaperItemInPlaylist(WallpaperItem item)
        {
            WallpaperItem newChildren = new WallpaperItem();

            newChildren.data = item.data;
            newChildren.SetValue(WallpaperItem.WallpaperNameProperty, item.WallpaperName.Content);
            newChildren.Margin = new Thickness(10, 10, 10, 10);
            newChildren.SetValue(WallpaperItem.ImagePathProperty, item.GetValue(WallpaperItem.ImagePathProperty));
            newChildren.WallpaperCheckbox.Visibility = Visibility.Hidden;
            this.Playlist.Children.Add(newChildren);
        }
Пример #2
0
        public WallpaperItem AddWallpaper(WallpaperManifestItem manifestItem)
        {
            WallpaperItem item = new WallpaperItem();

            item.data = manifestItem;
            item.SetValue(WallpaperItem.WallpaperNameProperty, manifestItem.WallpaperName);
            item.Margin = new Thickness(10, 10, 10, 10);


            string imagePath = System.IO.Path.Combine(
                System.IO.Path.GetDirectoryName(manifestItem.WallpaperPath),
                WallpaperManifest.GetWallpaper(manifestItem.WallpaperPath).WallpaperThumbnail
                );

            item.SetValue(WallpaperItem.ImagePathProperty, imagePath);
            item.WallpaperCheckbox.IsChecked = false;

            item.WallpaperCheckbox.Checked   += new RoutedEventHandler(CheckBoxChecked);
            item.WallpaperCheckbox.Unchecked += new RoutedEventHandler(CheckBoxUnchecked);
            item.ItemMask.MouseDown          += new MouseButtonEventHandler(ItemMaskClicked);
            MainWrapPanel.Children.Add(item);

            return(item);
        }