private void Image_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { ActivityPlaceLocation locations = (e.Source as FrameworkElement).DataContext as ActivityPlaceLocation; if (locations.activityPlaceLocationImage == null) { locations.activityPlaceLocationImage = new List <ActivityPlaceLocationImage>(); } ActivityManageDialog form = new ActivityManageDialog(locations.activityPlaceLocationImage, locations.GUID); form.ShowDialog(this); if (locations.activityPlaceLocationImage != null && locations.activityPlaceLocationImage.Count > 0) { MemoryStream stream = new MemoryStream(locations.activityPlaceLocationImage[0].Image); BitmapImage bmp = new BitmapImage(); bmp.BeginInit(); //初始化 bmp.StreamSource = stream; //设置源 bmp.EndInit(); //初始化结束 (e.Source as System.Windows.Controls.Image).Source = bmp; } //List<ListImage> listImageL = ActivityManageImage.listImage; //for (int i = 0; i < listImageL.Count; i++) //{ // if (listImageL[i].locationGuid == locations.GUID) // { // locations.activityPlaceLocationImage = listImageL[i].listAPLImage; // //locations.activityPlaceLocationImages = locations.activityPlaceLocationImage.ToArray(); // if (listImageL[i].listAPLImage.Count() > 0) // { // MemoryStream stream = new MemoryStream(listImageL[i].listAPLImage[0].Image); // BitmapImage bmp = new BitmapImage(); // bmp.BeginInit();//初始化 // bmp.StreamSource = stream;//设置源 // bmp.EndInit();//初始化结束 // (e.Source as System.Windows.Controls.Image).Source = bmp; // break; // } // } //} }
void p_ShowPlaceImageEvent(ActivityPlaceLocation obj) { ActivityManageDialog managerImage = new ActivityManageDialog(obj.activityPlaceLocationImage, ""); managerImage.ShowDialog(this); }