Ejemplo n.º 1
0
 /// <summary>
 /// 设置原始位置
 /// </summary>
 /// <param name="element">UI元素</param>
 private void SetOrginLocation(UIElement element)
 {
     if (CanvasExtension.GetAttachedTag(element) == null)
     {
         element.UpdateLayout();
         Point orginLocation = element.TransformToAncestor(this).Transform(new Point());
         CanvasExtension.SetAttachedTag(element, orginLocation);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 获取原始位置
 /// </summary>
 /// <param name="element">UI元素</param>
 /// <returns>原始位置</returns>
 private Point GetOrginLocation(UIElement element)
 {
     this.SetOrginLocation(element);
     return((Point)CanvasExtension.GetAttachedTag(element));
 }