public void SetChild(IWidgetBackend child) { // Remove the old child before adding the new one // The child has to be removed from the viewport if (ScrollViewer.Content != null) { var port = (CustomScrollViewPort)ScrollViewer.Content; port.Children.Remove(port.Children[0]); } if (child == null) { return; } SetChildPlacement(child); ScrollAdjustmentBackend vbackend = null, hbackend = null; var widget = (WidgetBackend)child; if (widget.EventSink.SupportsCustomScrolling()) { vscrollControl = vbackend = new ScrollAdjustmentBackend(); hscrollControl = hbackend = new ScrollAdjustmentBackend(); } ScrollViewer.Content = new CustomScrollViewPort(widget.NativeWidget, vbackend, hbackend); ScrollViewer.CanContentScroll = true; if (vbackend != null) { widget.EventSink.SetScrollAdjustments(hbackend, vbackend); } }
public void SetOffset(ScrollAdjustmentBackend scroller, double offset) { if (scroller == verticalBackend) { SetVerticalOffset(offset); } else { SetHorizontalOffset(offset); } }
internal CustomScrollViewPort(object widget, ScrollAdjustmentBackend verticalBackend, ScrollAdjustmentBackend horizontalBackend) { if (widget == null) throw new ArgumentNullException ("widget"); ((FrameworkElement)widget).RenderTransform = this.transform; if (verticalBackend != null) { usingCustomScrolling = true; verticalBackend.TargetViewport = this; this.verticalBackend = verticalBackend; horizontalBackend.TargetViewport = this; this.horizontalBackend = horizontalBackend; UpdateCustomExtent (); } Children.Add ((UIElement) widget); }
internal CustomScrollViewPort(object widget, ScrollAdjustmentBackend verticalBackend, ScrollAdjustmentBackend horizontalBackend) { if (widget == null) { throw new ArgumentNullException("widget"); } ((FrameworkElement)widget).RenderTransform = this.transform; if (verticalBackend != null) { usingCustomScrolling = true; verticalBackend.TargetViewport = this; this.verticalBackend = verticalBackend; horizontalBackend.TargetViewport = this; this.horizontalBackend = horizontalBackend; UpdateCustomExtent(); } Children.Add((UIElement)widget); }
public void SetChild(IWidgetBackend child) { // Remove the old child before adding the new one // The child has to be removed from the viewport if (ScrollViewer.Content != null) { var port = (CustomScrollViewPort)ScrollViewer.Content; port.Children.Remove (port.Children[0]); } if (child == null) return; ScrollAdjustmentBackend vbackend = null, hbackend = null; var widget = (WidgetBackend)child; if (widget.EventSink.SupportsCustomScrolling ()) { vbackend = new ScrollAdjustmentBackend (); hbackend = new ScrollAdjustmentBackend (); } ScrollViewer.Content = new CustomScrollViewPort (widget.NativeWidget, vbackend, hbackend); ScrollViewer.CanContentScroll = true; if (vbackend != null) widget.EventSink.SetScrollAdjustments (hbackend, vbackend); }
public void SetOffset(ScrollAdjustmentBackend scroller, double offset) { if (scroller == verticalBackend) SetVerticalOffset (offset); else SetHorizontalOffset (offset); }