浏览代码

Code and API doc cleanup

Tig 1 年之前
父节点
当前提交
32e79bdd17

+ 1 - 1
Terminal.Gui/View/Adornment/Adornment.cs

@@ -8,7 +8,7 @@
 /// <remarsk>
 /// <remarsk>
 ///     <para>
 ///     <para>
 ///         Each of <see cref="Margin"/>, <see cref="Border"/>, and <see cref="Padding"/> has slightly different
 ///         Each of <see cref="Margin"/>, <see cref="Border"/>, and <see cref="Padding"/> has slightly different
-///         behavior relative to <see cref="ColorScheme"/>, <see cref="View.SetFocus"/>, keyboard input, and
+///         behavior relative to <see cref="ColorScheme"/>, <see cref="View.SetFocus()"/>, keyboard input, and
 ///         mouse input. Each can be customized by manipulating their Subviews.
 ///         mouse input. Each can be customized by manipulating their Subviews.
 ///     </para>
 ///     </para>
 /// </remarsk>
 /// </remarsk>

+ 64 - 53
Terminal.Gui/View/ViewContent.cs

@@ -14,91 +14,106 @@ public enum ViewportSettings
     None = 0,
     None = 0,
 
 
     /// <summary>
     /// <summary>
-    ///     If set, <see cref="View.Viewport"/><c>.X</c> can be set to negative values enabling scrolling beyond the left of the
+    ///     If set, <see cref="View.Viewport"/><c>.X</c> can be set to negative values enabling scrolling beyond the left of
+    ///     the
     ///     content area.
     ///     content area.
     /// </summary>
     /// </summary>
     /// <remarks>
     /// <remarks>
-    /// <para>
-    ///     When not set, <see cref="View.Viewport"/><c>.X</c> is constrained to positive values.
-    /// </para>
+    ///     <para>
+    ///         When not set, <see cref="View.Viewport"/><c>.X</c> is constrained to positive values.
+    ///     </para>
     /// </remarks>
     /// </remarks>
     AllowNegativeX = 1,
     AllowNegativeX = 1,
 
 
     /// <summary>
     /// <summary>
     ///     If set, <see cref="View.Viewport"/><c>.Y</c> can be set to negative values enabling scrolling beyond the top of the
     ///     If set, <see cref="View.Viewport"/><c>.Y</c> can be set to negative values enabling scrolling beyond the top of the
-    ///     content area. 
+    ///     content area.
     /// </summary>
     /// </summary>
     /// <remarks>
     /// <remarks>
-    /// <para>
-    ///     When not set, <see cref="View.Viewport"/><c>.Y</c> is constrained to positive values.
-    /// </para>
+    ///     <para>
+    ///         When not set, <see cref="View.Viewport"/><c>.Y</c> is constrained to positive values.
+    ///     </para>
     /// </remarks>
     /// </remarks>
     AllowNegativeY = 2,
     AllowNegativeY = 2,
 
 
     /// <summary>
     /// <summary>
-    ///     If set, <see cref="View.Viewport"/><c>.Size</c> can be set to negative coordinates enabling scrolling beyond the top-left of the
+    ///     If set, <see cref="View.Viewport"/><c>.Size</c> can be set to negative coordinates enabling scrolling beyond the
+    ///     top-left of the
     ///     content area.
     ///     content area.
     /// </summary>
     /// </summary>
     /// <remarks>
     /// <remarks>
-    /// <para>
-    ///     When not set, <see cref="View.Viewport"/><c>.Size</c> is constrained to positive coordinates.
-    /// </para>
+    ///     <para>
+    ///         When not set, <see cref="View.Viewport"/><c>.Size</c> is constrained to positive coordinates.
+    ///     </para>
     /// </remarks>
     /// </remarks>
     AllowNegativeLocation = AllowNegativeX | AllowNegativeY,
     AllowNegativeLocation = AllowNegativeX | AllowNegativeY,
 
 
     /// <summary>
     /// <summary>
-    ///     If set, <see cref="View.Viewport"/><c>.X</c> can be set values greater than <see cref="View.ContentSize"/><c>.Width</c> enabling scrolling beyond the right
+    ///     If set, <see cref="View.Viewport"/><c>.X</c> can be set values greater than <see cref="View.ContentSize"/>
+    ///     <c>.Width</c> enabling scrolling beyond the right
     ///     of the content area.
     ///     of the content area.
     /// </summary>
     /// </summary>
     /// <remarks>
     /// <remarks>
-    /// <para>
-    ///     When not set, <see cref="View.Viewport"/><c>.X</c> is constrained to <see cref="View.ContentSize"/><c>.Width - 1</c>.
-    ///     This means the last column of the content will remain visible even if there is an attempt to scroll the Viewport past the last column.
-    /// </para>
+    ///     <para>
+    ///         When not set, <see cref="View.Viewport"/><c>.X</c> is constrained to <see cref="View.ContentSize"/>
+    ///         <c>.Width - 1</c>.
+    ///         This means the last column of the content will remain visible even if there is an attempt to scroll the
+    ///         Viewport past the last column.
+    ///     </para>
+    ///     <para>
+    ///         The practical effect of this is that the last column of the content will always be visible.
+    ///     </para>
     /// </remarks>
     /// </remarks>
     AllowXGreaterThanContentWidth = 4,
     AllowXGreaterThanContentWidth = 4,
 
 
     /// <summary>
     /// <summary>
-    ///     If set, <see cref="View.Viewport"/><c>.Y</c> can be set values greater than <see cref="View.ContentSize"/><c>.Height</c> enabling scrolling beyond the right
+    ///     If set, <see cref="View.Viewport"/><c>.Y</c> can be set values greater than <see cref="View.ContentSize"/>
+    ///     <c>.Height</c> enabling scrolling beyond the right
     ///     of the content area.
     ///     of the content area.
     /// </summary>
     /// </summary>
     /// <remarks>
     /// <remarks>
-    /// <para>
-    ///     When not set, <see cref="View.Viewport"/><c>.Y</c> is constrained to <see cref="View.ContentSize"/><c>.Height - 1</c>.
-    ///     This means the last row of the content will remain visible even if there is an attempt to scroll the Viewport past the last row.
-    /// </para>
+    ///     <para>
+    ///         When not set, <see cref="View.Viewport"/><c>.Y</c> is constrained to <see cref="View.ContentSize"/>
+    ///         <c>.Height - 1</c>.
+    ///         This means the last row of the content will remain visible even if there is an attempt to scroll the Viewport
+    ///         past the last row.
+    ///     </para>
+    ///     <para>
+    ///         The practical effect of this is that the last row of the content will always be visible.
+    ///     </para>
     /// </remarks>
     /// </remarks>
     AllowYGreaterThanContentHeight = 8,
     AllowYGreaterThanContentHeight = 8,
 
 
     /// <summary>
     /// <summary>
-    ///     If set, <see cref="View.Viewport"/><c>.Size</c> can be set values greater than <see cref="View.ContentSize"/> enabling scrolling beyond the bottom-right
+    ///     If set, <see cref="View.Viewport"/><c>.Size</c> can be set values greater than <see cref="View.ContentSize"/>
+    ///     enabling scrolling beyond the bottom-right
     ///     of the content area.
     ///     of the content area.
     /// </summary>
     /// </summary>
     /// <remarks>
     /// <remarks>
-    /// <para>
-    ///     When not set, <see cref="View.Viewport"/> is constrained to <see cref="View.ContentSize"/><c> -1</c>.
-    ///     This means the last column and row of the content will remain visible even if there is an attempt to
-    ///     scroll the Viewport past the last column or row.
-    /// </para>
+    ///     <para>
+    ///         When not set, <see cref="View.Viewport"/> is constrained to <see cref="View.ContentSize"/><c> -1</c>.
+    ///         This means the last column and row of the content will remain visible even if there is an attempt to
+    ///         scroll the Viewport past the last column or row.
+    ///     </para>
     /// </remarks>
     /// </remarks>
     AllowLocationGreaterThanContentSize = AllowXGreaterThanContentWidth | AllowYGreaterThanContentHeight,
     AllowLocationGreaterThanContentSize = AllowXGreaterThanContentWidth | AllowYGreaterThanContentHeight,
 
 
     /// <summary>
     /// <summary>
-    /// By default, clipping is applied to just the visible content within <see cref="View.Viewport"/>. In cases where the viewport is
-    /// larger than the content area (e.g. when <see cref="AllowNegativeLocation"/> is enabled), setting this flag will allow content
-    /// outside the <see cref="View.Viewport"/> to be drawn.
+    ///     By default, clipping is applied to the <see cref="View.Viewport"/>. Setting this flag will cause clipping to be
+    ///     applied to the visible content area.
     /// </summary>
     /// </summary>
-    ClipVisibleContentOnly = 16,
+    ClipContentOnly = 16,
 
 
     /// <summary>
     /// <summary>
-    /// If set <see cref="View.Clear()"/> will clear only the portion of the content
-    /// area that is visible within the <see cref="View.Viewport"/>. This is useful for views that have a
-    /// content area larger than the Viewport and want the area outside the content to be visually distinct.
+    ///     If set <see cref="View.Clear()"/> will clear only the portion of the content
+    ///     area that is visible within the <see cref="View.Viewport"/>. This is useful for views that have a
+    ///     content area larger than the Viewport and want the area outside the content to be visually distinct.
     /// </summary>
     /// </summary>
     /// <remarks>
     /// <remarks>
-    /// <see cref="ClipVisibleContentOnly"/> must be set for this setting to work (clipping beyond the visible area must be disabled).
+    ///     <see cref="ClipContentOnly"/> must be set for this setting to work (clipping beyond the visible area must be
+    ///     disabled).
     /// </remarks>
     /// </remarks>
-    ClearVisibleContentOnly = 32,
+    ClearContentOnly = 32
 }
 }
 
 
 public partial class View
 public partial class View
@@ -108,8 +123,8 @@ public partial class View
     private Size _contentSize;
     private Size _contentSize;
 
 
     /// <summary>
     /// <summary>
-    ///     Gets or sets the size of the View's content. If the value is <c>Size.Empty</c> the size of the content is
-    ///     the same as the size of <see cref="Viewport"/>, and <c>Viewport.Location</c> will always be <c>0, 0</c>.
+    ///     Gets or sets the size of the View's content. If not set, the value will be the same as the size of <see cref="Viewport"/>,
+    ///     and <c>Viewport.Location</c> will always be <c>0, 0</c>.
     /// </summary>
     /// </summary>
     /// <remarks>
     /// <remarks>
     ///     <para>
     ///     <para>
@@ -159,7 +174,7 @@ public partial class View
     }
     }
 
 
     /// <summary>
     /// <summary>
-    ///     Event that is raised when the <see cref="ContentSize"/> changes.
+    ///     Event raised when the <see cref="ContentSize"/> changes.
     /// </summary>
     /// </summary>
     public event EventHandler<SizeChangedEventArgs> ContentSizeChanged;
     public event EventHandler<SizeChangedEventArgs> ContentSizeChanged;
 
 
@@ -186,8 +201,7 @@ public partial class View
     ///     Content-relative means relative to the top-left corner of the view's Content, which is
     ///     Content-relative means relative to the top-left corner of the view's Content, which is
     ///     always at <c>0, 0</c>.
     ///     always at <c>0, 0</c>.
     /// </remarks>
     /// </remarks>
-    /// <param name="x">Column relative to the left side of the Content.</param>
-    /// <param name="y">Row relative to the top of the Content</param>
+    /// <param name="location">The Screen-relative location.</param>
     /// <returns>The coordinate relative to this view's Content.</returns>
     /// <returns>The coordinate relative to this view's Content.</returns>
     public Point ScreenToContent (in Point location)
     public Point ScreenToContent (in Point location)
     {
     {
@@ -246,14 +260,15 @@ public partial class View
     /// <remarks>
     /// <remarks>
     ///     <para>
     ///     <para>
     ///         Positive values for the location indicate the visible area is offset into (down-and-right) the View's virtual
     ///         Positive values for the location indicate the visible area is offset into (down-and-right) the View's virtual
-    ///         <see cref="ContentSize"/>. This enables virtual scrolling.
+    ///         <see cref="ContentSize"/>. This enables scrolling down and to the right (e.g. in a <see cref="ListView"/>.
     ///     </para>
     ///     </para>
     ///     <para>
     ///     <para>
     ///         Negative values for the location indicate the visible area is offset above (up-and-left) the View's virtual
     ///         Negative values for the location indicate the visible area is offset above (up-and-left) the View's virtual
-    ///         <see cref="ContentSize"/>. This enables virtual zoom.
+    ///         <see cref="ContentSize"/>. This enables scrolling up and to the left (e.g. in an image viewer that supports zoom
+    ///         where the image stays centered).
     ///     </para>
     ///     </para>
     ///     <para>
     ///     <para>
-    ///         The <see cref="ViewportSettings"/> property controls how scrolling is handled. If <see cref="ViewportSettings"/> is
+    ///         The <see cref="ViewportSettings"/> property controls how scrolling is handled. 
     ///     </para>
     ///     </para>
     ///     <para>
     ///     <para>
     ///         If <see cref="LayoutStyle"/> is <see cref="LayoutStyle.Computed"/> the value of Viewport is indeterminate until
     ///         If <see cref="LayoutStyle"/> is <see cref="LayoutStyle.Computed"/> the value of Viewport is indeterminate until
@@ -322,6 +337,7 @@ public partial class View
             }
             }
 
 
             OnViewportChanged (new (IsInitialized ? Viewport : Rectangle.Empty, oldViewport));
             OnViewportChanged (new (IsInitialized ? Viewport : Rectangle.Empty, oldViewport));
+
             return;
             return;
         }
         }
 
 
@@ -333,7 +349,6 @@ public partial class View
             Size = newSize
             Size = newSize
         };
         };
 
 
-
         void ApplySettings (ref Rectangle newViewport)
         void ApplySettings (ref Rectangle newViewport)
         {
         {
             if (!ViewportSettings.HasFlag (ViewportSettings.AllowXGreaterThanContentWidth))
             if (!ViewportSettings.HasFlag (ViewportSettings.AllowXGreaterThanContentWidth))
@@ -347,7 +362,6 @@ public partial class View
             // IMPORTANT: Check for negative location AFTER checking for location greater than content width
             // IMPORTANT: Check for negative location AFTER checking for location greater than content width
             if (!ViewportSettings.HasFlag (ViewportSettings.AllowNegativeX))
             if (!ViewportSettings.HasFlag (ViewportSettings.AllowNegativeX))
             {
             {
-
                 if (newViewport.X < 0)
                 if (newViewport.X < 0)
                 {
                 {
                     newViewport.X = 0;
                     newViewport.X = 0;
@@ -374,19 +388,16 @@ public partial class View
     }
     }
 
 
     /// <summary>
     /// <summary>
-    /// Fired when the <see cref="Frame"/> changes. This event is fired after the <see cref="Frame"/> has been updated.
+    ///     Fired when the <see cref="Viewport"/> changes. This event is fired after the <see cref="Viewport"/> has been updated.
     /// </summary>
     /// </summary>
     [CanBeNull]
     [CanBeNull]
     public event EventHandler<DrawEventArgs> ViewportChanged;
     public event EventHandler<DrawEventArgs> ViewportChanged;
 
 
     /// <summary>
     /// <summary>
-    /// Called when the <see cref="Frame"/> changes. Invokes the <see cref="ViewportChanged"/> event.
+    ///     Called when the <see cref="Viewport"/> changes. Invokes the <see cref="ViewportChanged"/> event.
     /// </summary>
     /// </summary>
     /// <param name="e"></param>
     /// <param name="e"></param>
-    protected virtual void OnViewportChanged (DrawEventArgs e)
-    {
-        ViewportChanged?.Invoke (this, e);
-    }
+    protected virtual void OnViewportChanged (DrawEventArgs e) { ViewportChanged?.Invoke (this, e); }
 
 
     /// <summary>
     /// <summary>
     ///     Converts a <see cref="Viewport"/>-relative location to a screen-relative location.
     ///     Converts a <see cref="Viewport"/>-relative location to a screen-relative location.

+ 12 - 6
Terminal.Gui/View/ViewDrawing.cs

@@ -84,7 +84,7 @@ public partial class View
     /// <summary>Clears <see cref="Viewport"/> with the normal background.</summary>
     /// <summary>Clears <see cref="Viewport"/> with the normal background.</summary>
     /// <remarks>
     /// <remarks>
     ///     <para>
     ///     <para>
-    ///         If <see cref="ViewportSettings"/> has <see cref="ViewportSettings.ClearVisibleContentOnly"/> only
+    ///         If <see cref="ViewportSettings"/> has <see cref="Gui.ViewportSettings.ClearContentOnly"/> only
     ///         the portion of the content
     ///         the portion of the content
     ///         area that is visible within the <see cref="View.Viewport"/> will be cleared. This is useful for views that have a
     ///         area that is visible within the <see cref="View.Viewport"/> will be cleared. This is useful for views that have a
     ///         content area larger than the Viewport (e.g. when <see cref="ViewportSettings.AllowNegativeLocation"/> is
     ///         content area larger than the Viewport (e.g. when <see cref="ViewportSettings.AllowNegativeLocation"/> is
@@ -104,7 +104,7 @@ public partial class View
 
 
         Rectangle prevClip = Driver.Clip;
         Rectangle prevClip = Driver.Clip;
 
 
-        if (ViewportSettings.HasFlag (ViewportSettings.ClearVisibleContentOnly))
+        if (ViewportSettings.HasFlag (ViewportSettings.ClearContentOnly))
         {
         {
             Rectangle visibleContent = ViewportToScreen (new (new (-Viewport.X, -Viewport.Y), ContentSize));
             Rectangle visibleContent = ViewportToScreen (new (new (-Viewport.X, -Viewport.Y), ContentSize));
             toClear = Rectangle.Intersect (toClear, visibleContent);
             toClear = Rectangle.Intersect (toClear, visibleContent);
@@ -143,9 +143,15 @@ public partial class View
 
 
     /// <summary>Sets the <see cref="ConsoleDriver"/>'s clip region to <see cref="Viewport"/>.</summary>
     /// <summary>Sets the <see cref="ConsoleDriver"/>'s clip region to <see cref="Viewport"/>.</summary>
     /// <remarks>
     /// <remarks>
-    ///     The clip region is set to the intersection of the current clip region and the
-    ///     <see cref="Viewport"/>. This ensures that drawing is constrained to the visible
-    ///     viewport of the view.
+    /// <para>
+    ///     By default, the clip rectangle is set to the intersection of the current clip region and the
+    ///     <see cref="Viewport"/>. This ensures that drawing is constrained to the viewport, but allows
+    ///     content to be drawn beyond the viewport.
+    /// </para>
+    /// <para>
+    ///     If <see cref="ViewportSettings"/> has <see cref="Gui.ViewportSettings.ClipContentOnly"/> set, clipping will be
+    ///     applied to just the visible content area.
+    /// </para>
     /// </remarks>
     /// </remarks>
     /// <returns>
     /// <returns>
     ///     The current screen-relative clip region, which can be then re-applied by setting
     ///     The current screen-relative clip region, which can be then re-applied by setting
@@ -163,7 +169,7 @@ public partial class View
         // Clamp the Clip to the entire visible area
         // Clamp the Clip to the entire visible area
         Rectangle clip = Rectangle.Intersect (ViewportToScreen (Viewport with { Location = Point.Empty }), previous);
         Rectangle clip = Rectangle.Intersect (ViewportToScreen (Viewport with { Location = Point.Empty }), previous);
 
 
-        if (ViewportSettings.HasFlag (ViewportSettings.ClipVisibleContentOnly))
+        if (ViewportSettings.HasFlag (ViewportSettings.ClipContentOnly))
         {
         {
             // Clamp the Clip to the just content area that is within the viewport
             // Clamp the Clip to the just content area that is within the viewport
             Rectangle visibleContent = ViewportToScreen (new (new (-Viewport.X, -Viewport.Y), ContentSize));
             Rectangle visibleContent = ViewportToScreen (new (new (-Viewport.X, -Viewport.Y), ContentSize));

+ 10 - 10
UICatalog/Scenarios/VirtualContent.cs

@@ -24,8 +24,8 @@ public class VirtualContent : Scenario
             Arrangement = ViewArrangement.Fixed;
             Arrangement = ViewArrangement.Fixed;
 
 
             ContentSize = new (60, 40);
             ContentSize = new (60, 40);
-            ViewportSettings |= ViewportSettings.ClearVisibleContentOnly;
-            ViewportSettings |= ViewportSettings.ClipVisibleContentOnly;
+            ViewportSettings |= ViewportSettings.ClearContentOnly;
+            ViewportSettings |= ViewportSettings.ClipContentOnly;
 
 
             // Things this view knows how to do
             // Things this view knows how to do
             AddCommand (Command.ScrollDown, () => ScrollVertical (1));
             AddCommand (Command.ScrollDown, () => ScrollVertical (1));
@@ -242,46 +242,46 @@ public class VirtualContent : Scenario
 
 
         var cbClearOnlyVisible = new CheckBox
         var cbClearOnlyVisible = new CheckBox
         {
         {
-            Title = "ClearVisibleContentOnly",
+            Title = "ClearContentOnly",
             X = Pos.Right (contentSizeHeight) + 1,
             X = Pos.Right (contentSizeHeight) + 1,
             Y = Pos.Top (labelContentSize),
             Y = Pos.Top (labelContentSize),
             CanFocus = false
             CanFocus = false
         };
         };
-        cbClearOnlyVisible.Checked = view.ViewportSettings.HasFlag (ViewportSettings.ClearVisibleContentOnly);
+        cbClearOnlyVisible.Checked = view.ViewportSettings.HasFlag (ViewportSettings.ClearContentOnly);
         cbClearOnlyVisible.Toggled += ClearVisibleContentOnly_Toggled;
         cbClearOnlyVisible.Toggled += ClearVisibleContentOnly_Toggled;
 
 
         void ClearVisibleContentOnly_Toggled (object sender, StateEventArgs<bool?> e)
         void ClearVisibleContentOnly_Toggled (object sender, StateEventArgs<bool?> e)
         {
         {
             if (e.NewValue == true)
             if (e.NewValue == true)
             {
             {
-                view.ViewportSettings |= ViewportSettings.ClearVisibleContentOnly;
+                view.ViewportSettings |= ViewportSettings.ClearContentOnly;
             }
             }
             else
             else
             {
             {
-                view.ViewportSettings &= ~ViewportSettings.ClearVisibleContentOnly;
+                view.ViewportSettings &= ~ViewportSettings.ClearContentOnly;
             }
             }
         }
         }
 
 
 
 
         var cbDoNotClipContent = new CheckBox
         var cbDoNotClipContent = new CheckBox
         {
         {
-            Title = "ClipVisibleContentOnly",
+            Title = "ClipContentOnly",
             X = Pos.Right (cbClearOnlyVisible) + 1,
             X = Pos.Right (cbClearOnlyVisible) + 1,
             Y = Pos.Top (labelContentSize),
             Y = Pos.Top (labelContentSize),
             CanFocus = false
             CanFocus = false
         };
         };
-        cbDoNotClipContent.Checked = view.ViewportSettings.HasFlag (ViewportSettings.ClipVisibleContentOnly);
+        cbDoNotClipContent.Checked = view.ViewportSettings.HasFlag (ViewportSettings.ClipContentOnly);
         cbDoNotClipContent.Toggled += ClipVisibleContentOnly_Toggled;
         cbDoNotClipContent.Toggled += ClipVisibleContentOnly_Toggled;
 
 
         void ClipVisibleContentOnly_Toggled (object sender, StateEventArgs<bool?> e)
         void ClipVisibleContentOnly_Toggled (object sender, StateEventArgs<bool?> e)
         {
         {
             if (e.NewValue == true)
             if (e.NewValue == true)
             {
             {
-                view.ViewportSettings |= ViewportSettings.ClipVisibleContentOnly;
+                view.ViewportSettings |= ViewportSettings.ClipContentOnly;
             }
             }
             else
             else
             {
             {
-                view.ViewportSettings &= ~ViewportSettings.ClipVisibleContentOnly;
+                view.ViewportSettings &= ~ViewportSettings.ClipContentOnly;
             }
             }
         }
         }
 
 

+ 2 - 2
UnitTests/View/DrawTests.cs

@@ -209,7 +209,7 @@ public class DrawTests (ITestOutputHelper output)
             X = 1, Y = 1,
             X = 1, Y = 1,
             Width = 3, Height = 3,
             Width = 3, Height = 3,
             BorderStyle = LineStyle.Single,
             BorderStyle = LineStyle.Single,
-            ViewportSettings = ViewportSettings.ClearVisibleContentOnly
+            ViewportSettings = ViewportSettings.ClearContentOnly
         };
         };
         superView.Add (view);
         superView.Add (view);
         superView.BeginInit ();
         superView.BeginInit ();
@@ -970,7 +970,7 @@ public class DrawTests (ITestOutputHelper output)
             Width = Dim.Fill (),
             Width = Dim.Fill (),
             Height = Dim.Fill (),
             Height = Dim.Fill (),
             ContentSize = new Size (10, 10),
             ContentSize = new Size (10, 10),
-            ViewportSettings = ViewportSettings.ClipVisibleContentOnly
+            ViewportSettings = ViewportSettings.ClipContentOnly
         };
         };
         view.Border.Thickness = new Thickness (1);
         view.Border.Thickness = new Thickness (1);
         view.BeginInit ();
         view.BeginInit ();