是否可以從受保護的override override void取消訂閱事件處理程序?取消訂閱來自Protected Override Void的事件處理程序
protected override void OnViewLoaded(object sender, ViewLoadedEventArg e)
{
base.OnViewLoaded(sender, e);
list = VisualTreeUtil.FindFirstInTree<ListView>(Application.Current.MainWindow, "ListView");
ConfigureAndSuperviseInputControls(this.list);
ScrollViewer scroll = VisualTreeUtil.FindFirstInTree<ScrollViewer>(this.list);
scroll.ScrollChanged+=new ScrollChangedEventHandler(scroll_ScrollChanged);
}
void scroll_ScrollChanged(object sender, ScrollChangedEventArgs e)
{
ConfigureAndSuperviseInputControls(this.list);
ScrollViewer sb = e.OriginalSource as ScrollViewer;
if (sb.ContentVerticalOffset==sb.ScrollableHeight)
{
scroll.ScrollChanged-=new ScrollChangedEventHandler(scroll_ScrollChanged);
}
}
我的問題是,我沒有得到訪問scroll_ScrollChanged方法中的滾動obejct。
是不是發送到對象的引用,你想? – Andy 2013-02-26 10:13:38