Freigeben über


Responding to comments

I just noticed that somebody asked an IScrollInfo question and I did not notice. I need to learn how to use the blogging software a little better :(

The question was basically about when ScrollOwner is set and why there are so many duplicated properties between the Panel and the ScrollViewer.

The reason why the properties are duplicated is because:

  • Not all Panels implement IScrollInfo, so sometimes the ScrollViewer is doing all of the work of figuring out Viewport, etc. The ScrollViewer needs to expose these properties all of the time.
  • The Panel is coming up with the scrolling parameters, and telling the ScrollViewer when they change, and the properties are a mechanism for the ScrollViewer to get the property values from the Panel. I don't have the source code handy, but I think that ScrollViewer returns cached values rather than passing the ask into the Panel.

Hopefully this makes sense. If anybody else has any more IScrollInfo queries, or questions about other WPF/Avalon stuff, I will be happy to answer (and I promise to check for comments more often).