private void ViewImage_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(lastSelected.ResourceImagePath) || lastSelected.ResourceImagePath == Resource.RES_DEFAULT_IMAGE)
            {
                return;
            }
            ViewPicture viewPicture = new ViewPicture();

            viewPicture.DataContext = lastSelected.Image;
            viewPicture.Show();
        }
Example #2
0
        //通过电影ID查找图片
        public List <ViewPicture> GetPictureByMovie(string MovieID)
        {
            var pictures   = context.MoviePicture.ToLookup(mp => mp.m_id)[MovieID].ToList();
            var returnList = new List <ViewPicture> {
            };

            foreach (var temp in pictures)
            {
                Picture temppicture = context.Picture.FirstOrDefault(p => p.pic_id == temp.pic_id);
                var     add         = new ViewPicture
                {
                    PictureID   = temppicture.pic_id,
                    PicturePath = temppicture.pic_path,
                    PictureInfo = temppicture.pic_info
                };
                returnList.Add(add);
            }
            return(returnList);
        }