protected virtual void RaiseScrollingStateChanged(ScrollingStateChangedEventArgs e) { var handler = ScrollingStateChanged; if (handler != null) { handler(this, e); } }
/// <summary> /// Handler for when the IsScrolling dependency property changes /// </summary> /// <param name="source">The object that has the property</param> /// <param name="e">Args</param> static void IsScrollingPropertyChanged(DependencyObject source, DependencyPropertyChangedEventArgs e) { var listbox = source as LazyListBox; if (listbox == null) { return; } // Call the virtual notification method for anyone who derives from this class var scrollingArgs = new ScrollingStateChangedEventArgs((bool)e.OldValue, (bool)e.NewValue); // Raise the event, if anyone is listening to it var handler = listbox.ScrollingStateChanged; if (handler != null) { handler(listbox, scrollingArgs); } }