Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
 public IScrollControlBackend CreateHorizontalScrollControl()
 {
     if (horScroll == null)
     {
         horScroll = new ScrollControlBackend(ApplicationContext, Widget, false);
     }
     return(horScroll);
 }
Exemplo n.º 3
0
 public IScrollControlBackend CreateVerticalScrollControl()
 {
     if (vertScroll == null)
     {
         vertScroll = new ScrollControlBackend(ApplicationContext, Widget, true);
     }
     return(vertScroll);
 }
Exemplo n.º 4
0
 public IScrollControlBackend CreateHorizontalScrollControl()
 {
     if (hscrollControl == null)
     {
         hscrollControl = new ScrollControlBackend(ScrollViewer, false);
     }
     return(hscrollControl);
 }
Exemplo n.º 5
0
 public IScrollControlBackend CreateVerticalScrollControl()
 {
     if (vscrollControl == null)
     {
         vscrollControl = new ScrollControlBackend(ScrollViewer, true);
     }
     return(vscrollControl);
 }
Exemplo n.º 6
0
		public IScrollControlBackend CreateHorizontalScrollControl()
		{
			if (hscrollControl == null)
				hscrollControl = new ScrollControlBackend(ScrollViewer, false);
			return hscrollControl;
		}
Exemplo n.º 7
0
		public IScrollControlBackend CreateVerticalScrollControl()
		{
			if (vscrollControl == null)
				vscrollControl = new ScrollControlBackend(ScrollViewer, true);
			return vscrollControl;
		}
Exemplo n.º 8
0
		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);
		}
Exemplo n.º 9
0
 internal ScrollControl(IScrollControlBackend backend)
 {
     BackendHost.SetCustomBackend(backend);
     backend.Initialize((ScrollAdjustmentBackendHost)BackendHost);
 }