Hi,
is there any way to determine the visible region of a WPF control that is clipped by parent controls (e.g. ScrollViewer, Canvas, or panes)?
Background of my question: we are using the WebBrowser control in our application. Since it is derived from HwndHost, parent controls cannot clip it, i.e. it will overlap parent controls, which does not look nice. Thefore, my idea was to automatically resize the WebBrowser control when it does not fit entirely into the parent controls. Our application is very flexible and therefore it is hard to predict what the hierarchy of parent controls for the WebBrowser control is. Therefore, I would need a method "UIElement.GetVisibleRegion()" that returns a Rect or Geometry with the visible part of the control, in control coordinates.
Many thanks for any helpful suggestions in advance.