diff --git a/Terminal.Gui/View/ViewContent.cs b/Terminal.Gui/View/ViewContent.cs
index 7fa48ed38..decd143d9 100644
--- a/Terminal.Gui/View/ViewContent.cs
+++ b/Terminal.Gui/View/ViewContent.cs
@@ -37,7 +37,7 @@ public partial class View
/// Negative sizes are not supported.
///
///
- public void SetContentSize (Size? contentSize)
+ private void SetContentSize (Size? contentSize)
{
if (ContentSize.Width < 0 || ContentSize.Height < 0)
{
@@ -65,7 +65,11 @@ public partial class View
/// .
///
///
- public Size ContentSize => _contentSize ?? Viewport.Size;
+ public Size ContentSize
+ {
+ get => _contentSize ?? Viewport.Size;
+ set => SetContentSize (value);
+ }
///
/// Called when has changed.
diff --git a/Terminal.Gui/Views/ColorPicker.cs b/Terminal.Gui/Views/ColorPicker.cs
index c61fdc5f3..01383dcc7 100644
--- a/Terminal.Gui/Views/ColorPicker.cs
+++ b/Terminal.Gui/Views/ColorPicker.cs
@@ -39,7 +39,7 @@ public class ColorPicker : View
Width = Dim.Auto (minimumContentDim: _boxWidth * _cols);
Height = Dim.Auto (minimumContentDim: _boxHeight * _rows);
- SetContentSize(new (_boxWidth * _cols, _boxHeight * _rows));
+ ContentSize = new (_boxWidth * _cols, _boxHeight * _rows);
MouseClick += ColorPicker_MouseClick;
}
@@ -67,7 +67,7 @@ public class ColorPicker : View
_boxHeight = value;
Width = Dim.Auto (minimumContentDim: _boxWidth * _cols);
Height = Dim.Auto (minimumContentDim: _boxHeight * _rows);
- SetContentSize (new (_boxWidth * _cols, _boxHeight * _rows));
+ ContentSize = new (_boxWidth * _cols, _boxHeight * _rows);
SetNeedsLayout ();
}
}
@@ -84,7 +84,7 @@ public class ColorPicker : View
_boxWidth = value;
Width = Dim.Auto (minimumContentDim: _boxWidth * _cols);
Height = Dim.Auto (minimumContentDim: _boxHeight * _rows);
- SetContentSize (new (_boxWidth * _cols, _boxHeight * _rows));
+ ContentSize = new (_boxWidth * _cols, _boxHeight * _rows);
SetNeedsLayout ();
}
}
@@ -178,9 +178,9 @@ public class ColorPicker : View
Driver.SetAttribute (HasFocus ? ColorScheme.Focus : GetNormalColor ());
var colorIndex = 0;
- for (var y = 0; y < Math.Max(2, viewport.Height / BoxHeight); y++)
+ for (var y = 0; y < Math.Max (2, viewport.Height / BoxHeight); y++)
{
- for (var x = 0; x < Math.Max(8, viewport.Width / BoxWidth); x++)
+ for (var x = 0; x < Math.Max (8, viewport.Width / BoxWidth); x++)
{
int foregroundColorIndex = y == 0 ? colorIndex + _cols : colorIndex - _cols;
Driver.SetAttribute (new Attribute ((ColorName)foregroundColorIndex, (ColorName)colorIndex));
diff --git a/Terminal.Gui/Views/DatePicker.cs b/Terminal.Gui/Views/DatePicker.cs
index d0cb41330..ba3459ba3 100644
--- a/Terminal.Gui/Views/DatePicker.cs
+++ b/Terminal.Gui/Views/DatePicker.cs
@@ -275,7 +275,7 @@ public class DatePicker : View
Height = Dim.Auto (DimAutoStyle.Content);
// BUGBUG: Remove when Dim.Auto(subviews) fully works
- SetContentSize (new (_calendar.Style.ColumnStyles.Sum (c => c.Value.MinWidth) + 7, _calendar.Frame.Height + 1));
+ ContentSize = new (_calendar.Style.ColumnStyles.Sum (c => c.Value.MinWidth) + 7, _calendar.Frame.Height + 1);
_dateField.DateChanged += DateField_DateChanged;
diff --git a/Terminal.Gui/Views/ListView.cs b/Terminal.Gui/Views/ListView.cs
index bf2586185..65ad03c64 100644
--- a/Terminal.Gui/Views/ListView.cs
+++ b/Terminal.Gui/Views/ListView.cs
@@ -264,7 +264,7 @@ public class ListView : View
}
_source = value;
- SetContentSize (new Size (_source?.Length ?? Viewport.Width, _source?.Count ?? Viewport.Width));
+ ContentSize = new Size (_source?.Length ?? Viewport.Width, _source?.Count ?? Viewport.Width);
if (IsInitialized)
{
Viewport = Viewport with { Y = 0 };
diff --git a/Terminal.Gui/Views/RadioGroup.cs b/Terminal.Gui/Views/RadioGroup.cs
index a42f6d840..7fcac2f3b 100644
--- a/Terminal.Gui/Views/RadioGroup.cs
+++ b/Terminal.Gui/Views/RadioGroup.cs
@@ -456,7 +456,7 @@ private void SetContentSize ()
width = Math.Max (s.GetColumns () + 2, width);
}
- SetContentSize (new (width, _radioLabels.Count));
+ ContentSize = new (width, _radioLabels.Count);
break;
case Orientation.Horizontal:
@@ -471,7 +471,7 @@ private void SetContentSize ()
length = _radioLabels [i].GetColumns () + 2 + (i < _radioLabels.Count - 1 ? _horizontalSpace : 0);
_horizontal.Add ((start, length));
}
- SetContentSize (new (_horizontal.Sum (item => item.length), 1));
+ ContentSize = new (_horizontal.Sum (item => item.length), 1);
break;
}
}
diff --git a/Terminal.Gui/Views/Slider.cs b/Terminal.Gui/Views/Slider.cs
index c42247299..095ce4210 100644
--- a/Terminal.Gui/Views/Slider.cs
+++ b/Terminal.Gui/Views/Slider.cs
@@ -464,7 +464,7 @@ public class Slider : View
CalcSpacingConfig (horizontal ? Viewport.Width : Viewport.Height);
}
- SetContentSize (new (GetIdealWidth (), GetIdealHeight ()));
+ ContentSize = new (GetIdealWidth (), GetIdealHeight ());
return;
diff --git a/UICatalog/Scenarios/ASCIICustomButton.cs b/UICatalog/Scenarios/ASCIICustomButton.cs
index f1e57c253..ab3e821d8 100644
--- a/UICatalog/Scenarios/ASCIICustomButton.cs
+++ b/UICatalog/Scenarios/ASCIICustomButton.cs
@@ -235,7 +235,7 @@ public class ASCIICustomButtonTest : Scenario
pages++;
}
- _scrollView.SetContentSize (new (25, pages * BUTTONS_ON_PAGE * BUTTON_HEIGHT));
+ _scrollView.ContentSize = new (25, pages * BUTTONS_ON_PAGE * BUTTON_HEIGHT);
if (_smallerWindow)
{
diff --git a/UICatalog/Scenarios/AllViewsTester.cs b/UICatalog/Scenarios/AllViewsTester.cs
index 704e1f904..f86fa8f32 100644
--- a/UICatalog/Scenarios/AllViewsTester.cs
+++ b/UICatalog/Scenarios/AllViewsTester.cs
@@ -416,11 +416,8 @@ public class AllViewsTester : Scenario
return;
}
- LayoutStyle layout = view.LayoutStyle;
-
try
{
- //view.LayoutStyle = LayoutStyle.Absolute;
view.X = _xRadioGroup.SelectedItem switch
{
diff --git a/UICatalog/Scenarios/CharacterMap.cs b/UICatalog/Scenarios/CharacterMap.cs
index 02c11da5c..8a45b2e2a 100644
--- a/UICatalog/Scenarios/CharacterMap.cs
+++ b/UICatalog/Scenarios/CharacterMap.cs
@@ -328,7 +328,7 @@ internal class CharMap : View
CanFocus = true;
CursorVisibility = CursorVisibility.Default;
- SetContentSize (new (RowWidth, (MaxCodePoint / 16 + 2) * _rowHeight));
+ ContentSize = new (RowWidth, (MaxCodePoint / 16 + 2) * _rowHeight);
AddCommand (
Command.ScrollUp,
diff --git a/UICatalog/Scenarios/Clipping.cs b/UICatalog/Scenarios/Clipping.cs
index 43d1d80ca..0aba6ece9 100644
--- a/UICatalog/Scenarios/Clipping.cs
+++ b/UICatalog/Scenarios/Clipping.cs
@@ -29,7 +29,7 @@ public class Clipping : Scenario
var scrollView = new ScrollView { X = 3, Y = 3, Width = 50, Height = 20 };
scrollView.ColorScheme = Colors.ColorSchemes ["Menu"];
- scrollView.SetContentSize (new (200, 100));
+ scrollView.ContentSize = new (200, 100);
//ContentOffset = Point.Empty,
scrollView.AutoHideScrollBars = true;
diff --git a/UICatalog/Scenarios/ContentScrolling.cs b/UICatalog/Scenarios/ContentScrolling.cs
index c9cd6387f..3aa9c8c7e 100644
--- a/UICatalog/Scenarios/ContentScrolling.cs
+++ b/UICatalog/Scenarios/ContentScrolling.cs
@@ -26,7 +26,7 @@ public class ContentScrolling : Scenario
BorderStyle = LineStyle.Rounded;
Arrangement = ViewArrangement.Fixed;
- SetContentSize (new (60, 40));
+ ContentSize = new (60, 40);
ViewportSettings |= ViewportSettings.ClearContentOnly;
ViewportSettings |= ViewportSettings.ClipContentOnly;
@@ -245,7 +245,7 @@ public class ContentScrolling : Scenario
return;
}
- view.SetContentSize (view.ContentSize with { Width = e.NewValue });
+ view.ContentSize = view.ContentSize with { Width = e.NewValue };
}
var labelComma = new Label
@@ -273,7 +273,7 @@ public class ContentScrolling : Scenario
return;
}
- view.SetContentSize (view.ContentSize with { Height = e.NewValue });
+ view.ContentSize = view.ContentSize with { Height = e.NewValue };
}
var cbClearOnlyVisible = new CheckBox
diff --git a/UICatalog/Scenarios/Scrolling.cs b/UICatalog/Scenarios/Scrolling.cs
index daf9ee60e..4d21452f5 100644
--- a/UICatalog/Scenarios/Scrolling.cs
+++ b/UICatalog/Scenarios/Scrolling.cs
@@ -44,7 +44,7 @@ public class Scrolling : Scenario
ShowVerticalScrollIndicator = true,
ShowHorizontalScrollIndicator = true
};
- scrollView.SetContentSize (new (120, 40));
+ scrollView.ContentSize = new (120, 40);
scrollView.Padding.Thickness = new (1);
label.Text = $"{scrollView}\nContentSize: {scrollView.ContentSize}\nContentOffset: {scrollView.ContentOffset}";
diff --git a/UnitTests/Application/MouseTests.cs b/UnitTests/Application/MouseTests.cs
index 458689008..eaa42138b 100644
--- a/UnitTests/Application/MouseTests.cs
+++ b/UnitTests/Application/MouseTests.cs
@@ -236,7 +236,7 @@ public class MouseTests
{
var tf = new TextField { Width = 10 };
var sv = new ScrollView { Width = Dim.Fill (), Height = Dim.Fill () };
- sv.SetContentSize (new (100, 100));
+ sv.ContentSize = new (100, 100);
sv.Add (tf);
var top = new Toplevel ();
diff --git a/UnitTests/UICatalog/ScenarioTests.cs b/UnitTests/UICatalog/ScenarioTests.cs
index 580cfcaec..facf601b2 100644
--- a/UnitTests/UICatalog/ScenarioTests.cs
+++ b/UnitTests/UICatalog/ScenarioTests.cs
@@ -106,7 +106,6 @@ public class ScenarioTests : TestsAllViews
// Settings
FrameView _settingsPane;
- CheckBox _computedCheckBox;
FrameView _locationFrame;
RadioGroup _xRadioGroup;
TextField _xText;
@@ -164,15 +163,13 @@ public class ScenarioTests : TestsAllViews
ColorScheme = Colors.ColorSchemes ["TopLevel"],
Title = "Settings"
};
- _computedCheckBox = new () { X = 0, Y = 0, Text = "Computed Layout", Checked = true };
- _settingsPane.Add (_computedCheckBox);
var radioItems = new [] { "Percent(x)", "AnchorEnd(x)", "Center", "Absolute(x)" };
_locationFrame = new ()
{
- X = Pos.Left (_computedCheckBox),
- Y = Pos.Bottom (_computedCheckBox),
+ X = 0,
+ Y = 0,
Height = 3 + radioItems.Length,
Width = 36,
Title = "Location (Pos)"
@@ -249,15 +246,6 @@ public class ScenarioTests : TestsAllViews
_curView = CreateClass (_viewClasses.Values.ToArray () [_classListView.SelectedItem]);
};
- _computedCheckBox.Toggled += (s, e) =>
- {
- if (_curView != null)
- {
- //_curView.LayoutStyle = e.OldValue == true ? LayoutStyle.Absolute : LayoutStyle.Computed;
- _hostPane.LayoutSubviews ();
- }
- };
-
_xRadioGroup.SelectedItemChanged += (s, selected) => DimPosChanged (_curView);
_xText.TextChanged += (s, args) =>
@@ -351,12 +339,8 @@ public class ScenarioTests : TestsAllViews
return;
}
- LayoutStyle layout = view.LayoutStyle;
-
try
{
- //view.LayoutStyle = LayoutStyle.Absolute;
-
switch (_xRadioGroup.SelectedItem)
{
case 0:
@@ -531,9 +515,6 @@ public class ScenarioTests : TestsAllViews
view?.GetType ().GetProperty ("Source")?.GetSetMethod ()?.Invoke (view, new [] { source });
}
- // Set Settings
- _computedCheckBox.Checked = view.LayoutStyle == LayoutStyle.Computed;
-
// Add
_hostPane.Add (view);
diff --git a/UnitTests/View/DrawTests.cs b/UnitTests/View/DrawTests.cs
index b11ad3fa8..339f7d096 100644
--- a/UnitTests/View/DrawTests.cs
+++ b/UnitTests/View/DrawTests.cs
@@ -921,7 +921,7 @@ public class DrawTests (ITestOutputHelper _output)
Height = Dim.Fill (),
ViewportSettings = ViewportSettings.ClipContentOnly
};
- view.SetContentSize (new Size (10, 10));
+ view.ContentSize = new Size (10, 10);
view.Border.Thickness = new Thickness (1);
view.BeginInit ();
view.EndInit ();
@@ -953,7 +953,7 @@ public class DrawTests (ITestOutputHelper _output)
Width = Dim.Fill (),
Height = Dim.Fill (),
};
- view.SetContentSize (new Size (10, 10));
+ view.ContentSize = new Size (10, 10);
view.Border.Thickness = new Thickness (1);
view.BeginInit ();
view.EndInit ();
diff --git a/UnitTests/View/FindDeepestViewTests.cs b/UnitTests/View/FindDeepestViewTests.cs
index c6ea6fa06..1273867d3 100644
--- a/UnitTests/View/FindDeepestViewTests.cs
+++ b/UnitTests/View/FindDeepestViewTests.cs
@@ -470,7 +470,7 @@ public class FindDeepestViewTests ()
subview.Padding.Thickness = new (1);
// Scroll the subview
- subview.SetContentSize (new (10, 10));
+ subview.ContentSize = new (10, 10);
subview.Viewport = subview.Viewport with { Location = new (1, 1) };
// This subview will be at the bottom-right-corner of subview
diff --git a/UnitTests/View/Layout/Dim.AutoTests.cs b/UnitTests/View/Layout/Dim.AutoTests.cs
index e77d3ce48..87e2dd95e 100644
--- a/UnitTests/View/Layout/Dim.AutoTests.cs
+++ b/UnitTests/View/Layout/Dim.AutoTests.cs
@@ -83,7 +83,7 @@ public class DimAutoTests (ITestOutputHelper output)
ValidatePosDim = true
};
- view.SetContentSize (new (contentSize, 0));
+ view.ContentSize = new (contentSize, 0);
Assert.Equal (expected, view.Frame.Width);
}
@@ -102,7 +102,7 @@ public class DimAutoTests (ITestOutputHelper output)
ValidatePosDim = true
};
- view.SetContentSize (new (contentSize, 0));
+ view.ContentSize = new (contentSize, 0);
view.SetRelativeLayout (new (100, 100));
Assert.Equal (expected, view.Frame.Width);
@@ -124,7 +124,7 @@ public class DimAutoTests (ITestOutputHelper output)
ValidatePosDim = true
};
- view.SetContentSize (new (contentSize, 0));
+ view.ContentSize = new (contentSize, 0);
view.SetRelativeLayout (new (100, 100));
Assert.Equal (expected, view.Frame.Width);
@@ -766,7 +766,7 @@ public class DimAutoTests (ITestOutputHelper output)
var view = new View ();
view.Width = Auto (DimAutoStyle.Text);
view.Height = Auto (DimAutoStyle.Text);
- view.SetContentSize (new (1, 1));
+ view.ContentSize = new (1, 1);
view.Text = text;
Assert.Equal (new (expectedW, expectedH), view.TextFormatter.Size);
}
@@ -963,7 +963,7 @@ public class DimAutoTests (ITestOutputHelper output)
public void DimAutoStyle_Content_UsesContentSize_WhenSet ()
{
var view = new View ();
- view.SetContentSize (new (10, 5));
+ view.ContentSize = new (10, 5);
var dim = Dim.Auto (DimAutoStyle.Content);
@@ -1299,7 +1299,7 @@ public class DimAutoTests (ITestOutputHelper output)
public void DimAutoStyle_Content_UsesContentSize_If_No_Subviews ()
{
DimAutoTestView view = new (Auto (DimAutoStyle.Content), Auto (DimAutoStyle.Content));
- view.SetContentSize (new (5, 5));
+ view.ContentSize = new (5, 5);
view.SetRelativeLayout (new (10, 10));
Assert.Equal (new (5, 5), view.Frame.Size);
diff --git a/UnitTests/View/Layout/LayoutTests.cs b/UnitTests/View/Layout/LayoutTests.cs
index d965e90e9..21a108259 100644
--- a/UnitTests/View/Layout/LayoutTests.cs
+++ b/UnitTests/View/Layout/LayoutTests.cs
@@ -123,7 +123,7 @@ public class LayoutTests (ITestOutputHelper output)
Width = 5,
Height = 5,
};
- superView.SetContentSize (new (10, 10));
+ superView.ContentSize = new (10, 10);
var view = new View ()
{
X = Pos.Center ()
diff --git a/UnitTests/View/Layout/ScreenToTests.cs b/UnitTests/View/Layout/ScreenToTests.cs
index 43b60ad99..c6d75e806 100644
--- a/UnitTests/View/Layout/ScreenToTests.cs
+++ b/UnitTests/View/Layout/ScreenToTests.cs
@@ -108,7 +108,7 @@ public class ScreenToTests
BorderStyle = LineStyle.Single,
};
var view = new View { X = viewX, Y = viewY, Width = 5, Height = 5 };
- view.SetContentSize (new (6, 6));
+ view.ContentSize = new (6, 6);
super.Add (view);
view.Viewport = new (1, 1, 5, 5);
@@ -164,7 +164,7 @@ public class ScreenToTests
X = viewX, Y = viewY, Width = 5, Height = 5,
BorderStyle = LineStyle.Single,
};
- view.SetContentSize (new (10, 10));
+ view.ContentSize = new (10, 10);
super.Add (view);
view.Viewport = view.Viewport with { Location = new (1, 1) };
diff --git a/UnitTests/View/Layout/ToScreenTests.cs b/UnitTests/View/Layout/ToScreenTests.cs
index 2524b0727..f9b5dc65a 100644
--- a/UnitTests/View/Layout/ToScreenTests.cs
+++ b/UnitTests/View/Layout/ToScreenTests.cs
@@ -336,7 +336,7 @@ public class ToScreenTests (ITestOutputHelper output)
Width = 10,
Height = 10
};
- view.SetContentSize (new (20, 20));
+ view.ContentSize = new (20, 20);
Point testPoint = new (0, 0);
Assert.Equal (new Point (1, 1), view.ContentToScreen (testPoint));
@@ -362,7 +362,7 @@ public class ToScreenTests (ITestOutputHelper output)
var view = new View ();
view.Frame = frame;
- view.SetContentSize (new (20, 20));
+ view.ContentSize = new (20, 20);
view.BorderStyle = LineStyle.Single;
// Act
@@ -403,7 +403,7 @@ public class ToScreenTests (ITestOutputHelper output)
var view = new View ();
view.Frame = frame;
- view.SetContentSize (new (20, 20));
+ view.ContentSize = new (20, 20);
superView.Add (view);
superView.LayoutSubviews ();
@@ -608,7 +608,7 @@ public class ToScreenTests (ITestOutputHelper output)
// var view = new View ();
// view.Frame = frame;
- // view.SetContentSize (new (11, 11));
+ // view.ContentSize = new (11, 11);
// view.Content = view.Content with { Location = new (1, 1) };
// superView.Add (view);
@@ -928,7 +928,7 @@ public class ToScreenTests (ITestOutputHelper output)
var view = new View ();
view.Frame = frame;
- view.SetContentSize (new (11, 11));
+ view.ContentSize = new (11, 11);
view.Viewport = view.Viewport with { Location = new (1, 1) };
superView.Add (view);
diff --git a/UnitTests/View/Layout/ViewportTests.cs b/UnitTests/View/Layout/ViewportTests.cs
index 9559fd672..5ba27d6d0 100644
--- a/UnitTests/View/Layout/ViewportTests.cs
+++ b/UnitTests/View/Layout/ViewportTests.cs
@@ -279,7 +279,7 @@ public class ViewportTests (ITestOutputHelper output)
{
// Arrange
var view = new View ();
- view.SetContentSize (new (100, 100));
+ view.ContentSize = new (100, 100);
var newViewport = new Rectangle (0, 0, 200, 200);
view.ViewportSettings = ViewportSettings.AllowLocationGreaterThanContentSize;
diff --git a/UnitTests/View/TextTests.cs b/UnitTests/View/TextTests.cs
index 66b639adc..e4bcc84ee 100644
--- a/UnitTests/View/TextTests.cs
+++ b/UnitTests/View/TextTests.cs
@@ -32,7 +32,7 @@ public class TextTests (ITestOutputHelper output)
public void TextFormatter_Size_Tracks_ContentSize (string text, int expectedW, int expectedH)
{
var view = new View ();
- view.SetContentSize(new (1,1));
+ view.ContentSize = new (1,1);
view.Text = text;
Assert.Equal (new (expectedW, expectedH), view.TextFormatter.Size);
}
diff --git a/UnitTests/Views/ScrollViewTests.cs b/UnitTests/Views/ScrollViewTests.cs
index 2e1b2ae2e..c658fd39b 100644
--- a/UnitTests/Views/ScrollViewTests.cs
+++ b/UnitTests/Views/ScrollViewTests.cs
@@ -12,7 +12,7 @@ public class ScrollViewTests
public void Adding_Views ()
{
var sv = new ScrollView { Width = 20, Height = 10 };
- sv.SetContentSize (new (30, 20));
+ sv.ContentSize = new (30, 20);
sv.Add (
new View { Width = 10, Height = 5 },
@@ -187,7 +187,7 @@ public class ScrollViewTests
Height = 10,
KeepContentAlwaysInViewport = false
};
- sv.SetContentSize (new (23, 23));
+ sv.ContentSize = new (23, 23);
var bottomLabel = new Label { X = 15, Y = 15, Text = "At 15,15" };
var top = new Toplevel ();
top.Add (topLabel, sv, bottomLabel);
@@ -378,7 +378,7 @@ public class ScrollViewTests
Height = 5,
ColorScheme = new ColorScheme { Normal = new Attribute (Color.Red, Color.Green) }
};
- sv.SetContentSize (size);
+ sv.ContentSize = size;
string text = null;
for (var i = 0; i < size.Height; i++)
@@ -447,7 +447,7 @@ public class ScrollViewTests
{
Width = 10, Height = 10,
};
- sv.SetContentSize (new (50, 50));
+ sv.ContentSize = new (50, 50);
sv.ContentOffset = new (25, 25);
var top = new Toplevel ();
@@ -482,7 +482,7 @@ public class ScrollViewTests
public void ContentSize_AutoHideScrollBars_ShowHorizontalScrollIndicator_ShowVerticalScrollIndicator ()
{
var sv = new ScrollView { Width = 10, Height = 10, };
- sv.SetContentSize (new (50, 50));
+ sv.ContentSize = new (50, 50);
var top = new Toplevel ();
top.Add (sv);
@@ -546,7 +546,7 @@ public class ScrollViewTests
ShowHorizontalScrollIndicator = true,
ShowVerticalScrollIndicator = true
};
- scrollView.SetContentSize (size);
+ scrollView.ContentSize = size;
scrollView.Add (view);
var win = new Window { X = 1, Y = 1, Width = 20, Height = 14 };
win.Add (scrollView);
@@ -871,7 +871,7 @@ public class ScrollViewTests
Width = 10,
Height = 10,
};
- sv.SetContentSize (new (50, 50));
+ sv.ContentSize = new (50, 50);
for (var i = 0; i < 8; i++)
{
@@ -921,7 +921,7 @@ public class ScrollViewTests
public void KeyBindings_Command ()
{
var sv = new ScrollView { Width = 20, Height = 10, };
- sv.SetContentSize (new (40, 20));
+ sv.ContentSize = new (40, 20);
sv.Add (
new View { Width = 20, Height = 5 },
@@ -1056,7 +1056,7 @@ public class ScrollViewTests
public void Remove_Added_View_Is_Allowed ()
{
var sv = new ScrollView { Width = 20, Height = 20, };
- sv.SetContentSize (new (100, 100));
+ sv.ContentSize = new (100, 100);
sv.Add (
new View { Width = Dim.Fill (), Height = Dim.Fill (50), Id = "View1" },
diff --git a/UnitTests/Views/SliderTests.cs b/UnitTests/Views/SliderTests.cs
index d418e31a8..3e3e532fc 100644
--- a/UnitTests/Views/SliderTests.cs
+++ b/UnitTests/Views/SliderTests.cs
@@ -519,7 +519,7 @@ public class SliderTests
Assert.Equal (new (6, 3), expectedSize);
- view.SetContentSize (new (1, 1));
+ view.ContentSize = new (1, 1);
view.LayoutSubviews ();
slider.SetRelativeLayout (view.Viewport.Size);
@@ -552,7 +552,7 @@ public class SliderTests
Assert.Equal (new (6, 10), expectedSize);
- view.SetContentSize (new (1, 1));
+ view.ContentSize = new (1, 1);
view.LayoutSubviews ();
slider.SetRelativeLayout (view.Viewport.Size);
@@ -585,7 +585,7 @@ public class SliderTests
Assert.Equal (new (10, 3), expectedSize);
- view.SetContentSize (new (1, 1));
+ view.ContentSize = new (1, 1);
view.LayoutSubviews ();
slider.SetRelativeLayout (view.Viewport.Size);
diff --git a/UnitTests/Views/ToplevelTests.cs b/UnitTests/Views/ToplevelTests.cs
index 62f4580fc..637898b3a 100644
--- a/UnitTests/Views/ToplevelTests.cs
+++ b/UnitTests/Views/ToplevelTests.cs
@@ -1321,7 +1321,7 @@ public class ToplevelTests
Width = 40,
Height = 16,
};
- scrollView.SetContentSize (new (200, 100));
+ scrollView.ContentSize = new (200, 100);
var win = new Window { X = 3, Y = 3, Width = Dim.Fill (3), Height = Dim.Fill (3), Arrangement = ViewArrangement.Movable };
scrollView.Add (win);
Toplevel top = new ();