0
我在畫布對象「CanvasContain」中有很多UI元素。在鼠標移動時,我想要抵消該畫布中的所有UI元素。我與畫布的名字嘗試,這是工作的罰款:如何在鼠標移動時更改畫布小孩的位置?
foreach(UIElement child in CanvasContain.Children)
{
if (child != null)
{
Canvas2.Offset -= position - LastMousePosition;
Canvas3.Offset -= position - LastMousePosition;
}
}
但是,當我嘗試用child.offset
它無法正常工作。我怎樣才能動態地改變偏移量?
順便說一句,我使用ZoomableCanvas zomming和平移 – srinivas