1. 程式人生 > >wpf 根據當前控制元件,查詢父視窗,呼叫父視窗的方法

wpf 根據當前控制元件,查詢父視窗,呼叫父視窗的方法

 FrameworkElement __do = this.Parent as FrameworkElement;
                while (__do != null)
                {
                    __do = __do.Parent as FrameworkElement;
                    if (__do.Parent == null) break;
                }
                (__do as Scheduling).GetDetail();