コード例 #1
0
        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            Wallpaper wallpaper = item as Wallpaper;

            if (wallpaper == null || wallpaper.ProjectInfo == null)
            {
                return(null);
            }

            var type = Wallpaper.GetType(wallpaper);

            switch (type)
            {
            case WallpaperType.Video:
                return(VideoTemplate);
            }
            return(null);
        }