コード例 #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);
            }
        }
コード例 #2
0
 public IScrollControlBackend CreateHorizontalScrollControl()
 {
     if (horScroll == null)
     {
         horScroll = new ScrollControlBackend(ApplicationContext, Widget, false);
     }
     return(horScroll);
 }
コード例 #3
0
 public IScrollControlBackend CreateVerticalScrollControl()
 {
     if (vertScroll == null)
     {
         vertScroll = new ScrollControlBackend(ApplicationContext, Widget, true);
     }
     return(vertScroll);
 }
コード例 #4
0
 public IScrollControlBackend CreateHorizontalScrollControl()
 {
     if (hscrollControl == null)
     {
         hscrollControl = new ScrollControlBackend(ScrollViewer, false);
     }
     return(hscrollControl);
 }
コード例 #5
0
 public IScrollControlBackend CreateVerticalScrollControl()
 {
     if (vscrollControl == null)
     {
         vscrollControl = new ScrollControlBackend(ScrollViewer, true);
     }
     return(vscrollControl);
 }
コード例 #6
0
ファイル: ScrollViewBackend.cs プロジェクト: m13253/xwt
		public IScrollControlBackend CreateHorizontalScrollControl()
		{
			if (hscrollControl == null)
				hscrollControl = new ScrollControlBackend(ScrollViewer, false);
			return hscrollControl;
		}
コード例 #7
0
ファイル: ScrollViewBackend.cs プロジェクト: m13253/xwt
		public IScrollControlBackend CreateVerticalScrollControl()
		{
			if (vscrollControl == null)
				vscrollControl = new ScrollControlBackend(ScrollViewer, true);
			return vscrollControl;
		}
コード例 #8
0
ファイル: ScrollViewBackend.cs プロジェクト: m13253/xwt
		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);
		}
コード例 #9
0
 internal ScrollControl(IScrollControlBackend backend)
 {
     BackendHost.SetCustomBackend(backend);
     backend.Initialize((ScrollAdjustmentBackendHost)BackendHost);
 }