public void setLayersZIndex() { for (int i = 0; i < stackLayer.Children.Count; i++) { LayerIcon li = stackLayer.Children[i] as LayerIcon; PhotoLayer pl = li.getLayer(); Canvas.SetZIndex(pl, stackLayer.Children.Count - stackLayer.Children.IndexOf(li)); } }
public void AddLayer(PhotoLayer o)//层永远加在最上面 { setLayersZIndex(); Canvas.SetZIndex(o, pc.getLayers().Children.Count); SelectLayerIcon = new LayerIcon(o); SelectLayerIcon.selectLayer += new LayerEventHandler(SelectLayerIcon_selectLayer); o.Selected(); //li.Init(o); SelectLayerIcon.PointerPressed += new PointerEventHandler(LayerIcon_PointerPressed); SelectLayerIcon.PointerReleased += new PointerEventHandler(LayerIcon_PointerReleased); stackLayer.Children.Add(SelectLayerIcon); pc.PhotoLayers.Children.Add(SelectLayerIcon.getLayer()); }