2010-11-21 68 views

回答

0

你需要看的是畫布的LayoutUpdated事件處理程序。

首先,您需要將頂部邊距的值存儲在單獨的字段/屬性中。

double top = 0; 
top = YourCanvas.Margin.Top; 

然後,在LayoutUpdated事件處理程序可以檢查保證金是否被修改:

void LayoutRoot_LayoutUpdated(object sender, EventArgs e) 
{ 
    if (LayoutRoot.Margin.Top != top) 
    { 
     // Your action here 
     Debug.WriteLine("CHANGED!"); 
    } 
}