看到一段代码,不知道什么意思,求解释一下
private void canvas_Drop(object sender ,DragEventArgs e){isImagerDrag=false;
ImageAndTextDecorator sourceImage=e.Data.getData(typeof(ImageAndTextDecorator)) as ImageAndTextDecorator;
if(sourceImage==null)
{return;}
Point newLocation;
if(calculateLovation(e,out newLocation)==false)
return;
if(!(e.OriginalSource is Border))
return;
MyIage newImage = new MyIage
newimage.source = sourceImage.ImageSource;
newimage.width =newimage.height=39+39+39+1+1;
newimage.setvalue(Canvas.LeftProperty, newLocation.Y-40);
canvas.Children.add(newimage);
if(border !=null)
{border.setvalue(Camvas.TopProperty,3.0)
MyImage是一个自定义控件 --------------------编程问答-------------------- 没有上下文,不能准确告诉你是什么意思。
大概是响应拖放,将图片装入目标所在位置的容器中
补充:.NET技术 , C#