diff --git a/.ncrunch/SafeAreaDemo.Android.v3.ncrunchproject b/.ncrunch/SafeAreaDemo.Android.v3.ncrunchproject
new file mode 100644
index 0000000000..319cd523ce
--- /dev/null
+++ b/.ncrunch/SafeAreaDemo.Android.v3.ncrunchproject
@@ -0,0 +1,5 @@
+
+
+ True
+
+
\ No newline at end of file
diff --git a/.ncrunch/SafeAreaDemo.Desktop.v3.ncrunchproject b/.ncrunch/SafeAreaDemo.Desktop.v3.ncrunchproject
new file mode 100644
index 0000000000..319cd523ce
--- /dev/null
+++ b/.ncrunch/SafeAreaDemo.Desktop.v3.ncrunchproject
@@ -0,0 +1,5 @@
+
+
+ True
+
+
\ No newline at end of file
diff --git a/.ncrunch/SafeAreaDemo.iOS.v3.ncrunchproject b/.ncrunch/SafeAreaDemo.iOS.v3.ncrunchproject
new file mode 100644
index 0000000000..319cd523ce
--- /dev/null
+++ b/.ncrunch/SafeAreaDemo.iOS.v3.ncrunchproject
@@ -0,0 +1,5 @@
+
+
+ True
+
+
\ No newline at end of file
diff --git a/.ncrunch/SafeAreaDemo.v3.ncrunchproject b/.ncrunch/SafeAreaDemo.v3.ncrunchproject
new file mode 100644
index 0000000000..319cd523ce
--- /dev/null
+++ b/.ncrunch/SafeAreaDemo.v3.ncrunchproject
@@ -0,0 +1,5 @@
+
+
+ True
+
+
\ No newline at end of file
diff --git a/samples/ControlCatalog/Pages/AutoCompleteBoxPage.xaml.cs b/samples/ControlCatalog/Pages/AutoCompleteBoxPage.xaml.cs
index ae7e43f511..81d379ce05 100644
--- a/samples/ControlCatalog/Pages/AutoCompleteBoxPage.xaml.cs
+++ b/samples/ControlCatalog/Pages/AutoCompleteBoxPage.xaml.cs
@@ -114,7 +114,7 @@ namespace ControlCatalog.Pages
foreach (AutoCompleteBox box in GetAllAutoCompleteBox().Where(x => x.Name != "CustomAutocompleteBox"))
{
- box.Items = States;
+ box.ItemsSource = States;
}
var converter = new FuncMultiValueConverter(parts =>
@@ -132,7 +132,7 @@ namespace ControlCatalog.Pages
asyncBox.AsyncPopulator = PopulateAsync;
var customAutocompleteBox = this.Get("CustomAutocompleteBox");
- customAutocompleteBox.Items = Sentences.SelectMany(x => x);
+ customAutocompleteBox.ItemsSource = Sentences.SelectMany(x => x);
customAutocompleteBox.TextFilter = LastWordContains;
customAutocompleteBox.TextSelector = AppendWord;
}
diff --git a/samples/ControlCatalog/Pages/ContextFlyoutPage.xaml b/samples/ControlCatalog/Pages/ContextFlyoutPage.xaml
index cb294442d2..56f8547740 100644
--- a/samples/ControlCatalog/Pages/ContextFlyoutPage.xaml
+++ b/samples/ControlCatalog/Pages/ContextFlyoutPage.xaml
@@ -67,7 +67,7 @@
-
+
diff --git a/samples/ControlCatalog/Pages/DataGridPage.xaml b/samples/ControlCatalog/Pages/DataGridPage.xaml
index c39e9f0a81..fb097da71b 100644
--- a/samples/ControlCatalog/Pages/DataGridPage.xaml
+++ b/samples/ControlCatalog/Pages/DataGridPage.xaml
@@ -94,7 +94,7 @@
+ ItemsSource="{Binding DataGrid3Source}">
diff --git a/samples/ControlCatalog/Pages/DataGridPage.xaml.cs b/samples/ControlCatalog/Pages/DataGridPage.xaml.cs
index b0c3e3a553..617b0db5ed 100644
--- a/samples/ControlCatalog/Pages/DataGridPage.xaml.cs
+++ b/samples/ControlCatalog/Pages/DataGridPage.xaml.cs
@@ -36,7 +36,7 @@ namespace ControlCatalog.Pages
collectionView1.SortDescriptions.Add(dataGridSortDescription);
}
};
- dg1.Items = collectionView1;
+ dg1.ItemsSource = collectionView1;
var dg2 = this.Get("dataGridGrouping");
dg2.IsReadOnly = true;
@@ -44,7 +44,7 @@ namespace ControlCatalog.Pages
var collectionView2 = new DataGridCollectionView(Countries.All);
collectionView2.GroupDescriptions.Add(new DataGridPathGroupDescription("Region"));
- dg2.Items = collectionView2;
+ dg2.ItemsSource = collectionView2;
var dg3 = this.Get("dataGridEdit");
dg3.IsReadOnly = false;
diff --git a/samples/ControlCatalog/Pages/DialogsPage.xaml b/samples/ControlCatalog/Pages/DialogsPage.xaml
index 90c717e7ed..980b210aaa 100644
--- a/samples/ControlCatalog/Pages/DialogsPage.xaml
+++ b/samples/ControlCatalog/Pages/DialogsPage.xaml
@@ -45,7 +45,7 @@
-
+ DesktopDocuments
@@ -54,7 +54,7 @@
VideosMusic
-
+
-
diff --git a/src/Avalonia.Controls.DataGrid/DataGrid.cs b/src/Avalonia.Controls.DataGrid/DataGrid.cs
index 030776ba14..e56e32a5ff 100644
--- a/src/Avalonia.Controls.DataGrid/DataGrid.cs
+++ b/src/Avalonia.Controls.DataGrid/DataGrid.cs
@@ -152,8 +152,6 @@ namespace Avalonia.Controls
private double _verticalOffset;
private byte _verticalScrollChangesIgnored;
- private IEnumerable _items;
-
public event EventHandler HorizontalScroll;
public event EventHandler VerticalScroll;
@@ -652,21 +650,18 @@ namespace Avalonia.Controls
}
///
- /// Identifies the ItemsSource dependency property.
+ /// Identifies the ItemsSource property.
///
- public static readonly DirectProperty ItemsProperty =
- AvaloniaProperty.RegisterDirect(
- nameof(Items),
- o => o.Items,
- (o, v) => o.Items = v);
+ public static readonly StyledProperty ItemsSourceProperty =
+ AvaloniaProperty.Register(nameof(ItemsSource));
///
/// Gets or sets a collection that is used to generate the content of the control.
///
- public IEnumerable Items
+ public IEnumerable ItemsSource
{
- get { return _items; }
- set { SetAndRaise(ItemsProperty, ref _items, value); }
+ get => GetValue(ItemsSourceProperty);
+ set => SetValue(ItemsSourceProperty, value);
}
public static readonly StyledProperty AreRowDetailsFrozenProperty =
@@ -713,7 +708,7 @@ namespace Avalonia.Controls
HorizontalScrollBarVisibilityProperty,
VerticalScrollBarVisibilityProperty);
- ItemsProperty.Changed.AddClassHandler((x, e) => x.OnItemsPropertyChanged(e));
+ ItemsSourceProperty.Changed.AddClassHandler((x, e) => x.OnItemsSourcePropertyChanged(e));
CanUserResizeColumnsProperty.Changed.AddClassHandler((x, e) => x.OnCanUserResizeColumnsChanged(e));
ColumnWidthProperty.Changed.AddClassHandler((x, e) => x.OnColumnWidthChanged(e));
FrozenColumnCountProperty.Changed.AddClassHandler((x, e) => x.OnFrozenColumnCountChanged(e));
@@ -816,10 +811,10 @@ namespace Avalonia.Controls
}
///
- /// ItemsProperty property changed handler.
+ /// ItemsSourceProperty property changed handler.
///
/// The event arguments.
- private void OnItemsPropertyChanged(AvaloniaPropertyChangedEventArgs e)
+ private void OnItemsSourcePropertyChanged(AvaloniaPropertyChangedEventArgs e)
{
if (!_areHandlersSuspended)
{
@@ -830,7 +825,7 @@ namespace Avalonia.Controls
if (LoadingOrUnloadingRow)
{
- SetValueNoCallback(ItemsProperty, oldValue);
+ SetValueNoCallback(ItemsSourceProperty, oldValue);
throw DataGridError.DataGrid.CannotChangeItemsWhenLoadingRows();
}
@@ -1855,7 +1850,7 @@ namespace Avalonia.Controls
{
get
{
- if (CurrentSlot == -1 || Items == null || RowGroupHeadersTable.Contains(CurrentSlot))
+ if (CurrentSlot == -1 || ItemsSource == null || RowGroupHeadersTable.Contains(CurrentSlot))
{
return null;
}
diff --git a/src/Avalonia.Controls.DataGrid/DataGridBoundColumn.cs b/src/Avalonia.Controls.DataGrid/DataGridBoundColumn.cs
index 110590fef2..61a1eb2bf0 100644
--- a/src/Avalonia.Controls.DataGrid/DataGridBoundColumn.cs
+++ b/src/Avalonia.Controls.DataGrid/DataGridBoundColumn.cs
@@ -25,7 +25,7 @@ namespace Avalonia.Controls
///
//TODO Binding
[AssignBinding]
- [InheritDataTypeFromItems(nameof(DataGrid.Items), AncestorType = typeof(DataGrid))]
+ [InheritDataTypeFromItems(nameof(DataGrid.ItemsSource), AncestorType = typeof(DataGrid))]
public virtual IBinding Binding
{
get
diff --git a/src/Avalonia.Controls.DataGrid/DataGridDataConnection.cs b/src/Avalonia.Controls.DataGrid/DataGridDataConnection.cs
index ae52e5f970..ee9cc04420 100644
--- a/src/Avalonia.Controls.DataGrid/DataGridDataConnection.cs
+++ b/src/Avalonia.Controls.DataGrid/DataGridDataConnection.cs
@@ -122,9 +122,9 @@ namespace Avalonia.Controls
// We need to use the raw ItemsSource as opposed to DataSource because DataSource
// may be the ItemsSource wrapped in a collection view, in which case we wouldn't
// be able to take T to be the type if we're given IEnumerable
- if (_dataType == null && _owner.Items != null)
+ if (_dataType == null && _owner.ItemsSource != null)
{
- _dataType = _owner.Items.GetItemType();
+ _dataType = _owner.ItemsSource.GetItemType();
}
return _dataType;
}
diff --git a/src/Avalonia.Controls.DataGrid/DataGridTemplateColumn.cs b/src/Avalonia.Controls.DataGrid/DataGridTemplateColumn.cs
index 00318e2dd8..0bfb4b6913 100644
--- a/src/Avalonia.Controls.DataGrid/DataGridTemplateColumn.cs
+++ b/src/Avalonia.Controls.DataGrid/DataGridTemplateColumn.cs
@@ -24,7 +24,7 @@ namespace Avalonia.Controls
(o, v) => o.CellTemplate = v);
[Content]
- [InheritDataTypeFromItems(nameof(DataGrid.Items), AncestorType = typeof(DataGrid))]
+ [InheritDataTypeFromItems(nameof(DataGrid.ItemsSource), AncestorType = typeof(DataGrid))]
public IDataTemplate CellTemplate
{
get { return _cellTemplate; }
@@ -51,7 +51,7 @@ namespace Avalonia.Controls
///
/// If this property is the column is read-only.
///
- [InheritDataTypeFromItems(nameof(DataGrid.Items), AncestorType = typeof(DataGrid))]
+ [InheritDataTypeFromItems(nameof(DataGrid.ItemsSource), AncestorType = typeof(DataGrid))]
public IDataTemplate CellEditingTemplate
{
get => _cellEditingCellTemplate;
diff --git a/src/Avalonia.Controls.ItemsRepeater/Controls/ItemsRepeater.cs b/src/Avalonia.Controls.ItemsRepeater/Controls/ItemsRepeater.cs
index 499904deac..5fe9c6fa05 100644
--- a/src/Avalonia.Controls.ItemsRepeater/Controls/ItemsRepeater.cs
+++ b/src/Avalonia.Controls.ItemsRepeater/Controls/ItemsRepeater.cs
@@ -36,13 +36,13 @@ namespace Avalonia.Controls
ItemsControl.ItemTemplateProperty.AddOwner();
///
- /// Defines the property.
+ /// Defines the property.
///
- public static readonly DirectProperty ItemsProperty =
+ public static readonly DirectProperty ItemsSourceProperty =
AvaloniaProperty.RegisterDirect(
- nameof(Items),
- o => o.Items,
- (o, v) => o.Items = v);
+ nameof(ItemsSource),
+ o => o.ItemsSource,
+ (o, v) => o.ItemsSource = v);
///
/// Defines the property.
@@ -65,7 +65,7 @@ namespace Avalonia.Controls
private readonly ViewManager _viewManager;
private readonly ViewportManager _viewportManager;
private readonly TargetWeakEventSubscriber _layoutWeakSubscriber;
- private IEnumerable? _items;
+ private IEnumerable? _itemsSource;
private RepeaterLayoutContext? _layoutContext;
private EventHandler? _childIndexChanged;
private bool _isLayoutInProgress;
@@ -116,16 +116,16 @@ namespace Avalonia.Controls
///
/// Gets or sets an object source used to generate the content of the ItemsRepeater.
///
- public IEnumerable? Items
+ public IEnumerable? ItemsSource
{
- get => _items;
- set => SetAndRaise(ItemsProperty, ref _items, value);
+ get => _itemsSource;
+ set => SetAndRaise(ItemsSourceProperty, ref _itemsSource, value);
}
///
/// Gets or sets the template used to display each item.
///
- [InheritDataTypeFromItems(nameof(Items))]
+ [InheritDataTypeFromItems(nameof(ItemsSource))]
public IDataTemplate? ItemTemplate
{
get => GetValue(ItemTemplateProperty);
@@ -415,7 +415,7 @@ namespace Avalonia.Controls
///
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
{
- if (change.Property == ItemsProperty)
+ if (change.Property == ItemsSourceProperty)
{
var (oldEnumerable, newEnumerable) = change.GetOldAndNewValue();
diff --git a/src/Avalonia.Controls/AutoCompleteBox/AutoCompleteBox.Properties.cs b/src/Avalonia.Controls/AutoCompleteBox/AutoCompleteBox.Properties.cs
index b38151854b..47a0c531ba 100644
--- a/src/Avalonia.Controls/AutoCompleteBox/AutoCompleteBox.Properties.cs
+++ b/src/Avalonia.Controls/AutoCompleteBox/AutoCompleteBox.Properties.cs
@@ -143,12 +143,12 @@ namespace Avalonia.Controls
nameof(TextSelector));
///
- /// Identifies the property.
+ /// Identifies the property.
///
- /// The identifier for the property.
- public static readonly StyledProperty ItemsProperty =
+ /// The identifier for the property.
+ public static readonly StyledProperty ItemsSourceProperty =
AvaloniaProperty.Register(
- nameof(Items));
+ nameof(ItemsSource));
///
/// Identifies the property.
@@ -311,10 +311,10 @@ namespace Avalonia.Controls
///
/// Gets the text that is used to filter items in the
- /// item collection.
+ /// item collection.
///
/// The text that is used to filter items in the
- /// item collection.
+ /// item collection.
///
/// The SearchText value is typically the same as the
/// Text property, but is set after the TextChanged event occurs
@@ -339,7 +339,7 @@ namespace Avalonia.Controls
///
/// Gets or sets how the text in the text box is used to filter items
- /// specified by the
+ /// specified by the
/// property for display in the drop-down.
///
/// One of the
@@ -366,11 +366,11 @@ namespace Avalonia.Controls
///
/// Gets or sets the custom method that uses user-entered text to filter
- /// the items specified by the
+ /// the items specified by the
/// property for display in the drop-down.
///
/// The custom method that uses the user-entered text to filter
- /// the items specified by the
+ /// the items specified by the
/// property. The default is null.
///
/// The filter mode is automatically set to Custom if you set the
@@ -384,11 +384,11 @@ namespace Avalonia.Controls
///
/// Gets or sets the custom method that uses the user-entered text to
- /// filter items specified by the
+ /// filter items specified by the
/// property in a text-based way for display in the drop-down.
///
/// The custom method that uses the user-entered text to filter
- /// items specified by the
+ /// items specified by the
/// property in a text-based way for display in the drop-down.
///
/// The search mode is automatically set to Custom if you set the
@@ -402,11 +402,11 @@ namespace Avalonia.Controls
///
/// Gets or sets the custom method that combines the user-entered
- /// text and one of the items specified by the .
+ /// text and one of the items specified by the .
///
///
/// The custom method that combines the user-entered
- /// text and one of the items specified by the .
+ /// text and one of the items specified by the .
///
public AutoCompleteSelector
/// The collection that is used to generate the items of the
/// drop-down portion of the control.
- public IEnumerable? Items
+ public IEnumerable? ItemsSource
{
- get => GetValue(ItemsProperty);
- set => SetValue(ItemsProperty, value);
+ get => GetValue(ItemsSourceProperty);
+ set => SetValue(ItemsSourceProperty, value);
}
}
}
diff --git a/src/Avalonia.Controls/AutoCompleteBox/AutoCompleteBox.cs b/src/Avalonia.Controls/AutoCompleteBox/AutoCompleteBox.cs
index 72a23144cf..e10cc1d100 100644
--- a/src/Avalonia.Controls/AutoCompleteBox/AutoCompleteBox.cs
+++ b/src/Avalonia.Controls/AutoCompleteBox/AutoCompleteBox.cs
@@ -419,9 +419,9 @@ namespace Avalonia.Controls
/// ItemsSourceProperty property changed handler.
///
/// Event arguments.
- private void OnItemsPropertyChanged(AvaloniaPropertyChangedEventArgs e)
+ private void OnItemsSourcePropertyChanged(AvaloniaPropertyChangedEventArgs e)
{
- OnItemsChanged((IEnumerable?)e.NewValue);
+ OnItemsSourceChanged((IEnumerable?)e.NewValue);
}
private void OnItemTemplatePropertyChanged(AvaloniaPropertyChangedEventArgs e)
@@ -461,7 +461,7 @@ namespace Avalonia.Controls
SearchTextProperty.Changed.AddClassHandler((x,e) => x.OnSearchTextPropertyChanged(e));
FilterModeProperty.Changed.AddClassHandler((x,e) => x.OnFilterModePropertyChanged(e));
ItemFilterProperty.Changed.AddClassHandler((x,e) => x.OnItemFilterPropertyChanged(e));
- ItemsProperty.Changed.AddClassHandler((x,e) => x.OnItemsPropertyChanged(e));
+ ItemsSourceProperty.Changed.AddClassHandler((x,e) => x.OnItemsSourcePropertyChanged(e));
ItemTemplateProperty.Changed.AddClassHandler((x,e) => x.OnItemTemplatePropertyChanged(e));
IsEnabledProperty.Changed.AddClassHandler((x,e) => x.OnControlIsEnabledChanged(e));
}
@@ -559,7 +559,7 @@ namespace Avalonia.Controls
_adapter.Commit -= OnAdapterSelectionComplete;
_adapter.Cancel -= OnAdapterSelectionCanceled;
_adapter.Cancel -= OnAdapterSelectionComplete;
- _adapter.Items = null;
+ _adapter.ItemsSource = null;
}
_adapter = value;
@@ -570,7 +570,7 @@ namespace Avalonia.Controls
_adapter.Commit += OnAdapterSelectionComplete;
_adapter.Cancel += OnAdapterSelectionCanceled;
_adapter.Cancel += OnAdapterSelectionComplete;
- _adapter.Items = _view;
+ _adapter.ItemsSource = _view;
}
}
}
@@ -1128,7 +1128,7 @@ namespace Avalonia.Controls
{
if (!cancellationToken.IsCancellationRequested)
{
- SetCurrentValue(ItemsProperty, resultList);
+ SetCurrentValue(ItemsSourceProperty, resultList);
PopulateComplete();
}
});
@@ -1475,7 +1475,7 @@ namespace Avalonia.Controls
/// adapter's ItemsSource to the view if appropriate.
///
/// The new enumerable reference.
- private void OnItemsChanged(IEnumerable? newValue)
+ private void OnItemsSourceChanged(IEnumerable? newValue)
{
// Remove handler for oldValue.CollectionChanged (if present)
_collectionChangeSubscription?.Dispose();
@@ -1492,9 +1492,9 @@ namespace Avalonia.Controls
// Clear and set the view on the selection adapter
ClearView();
- if (SelectionAdapter != null && SelectionAdapter.Items != _view)
+ if (SelectionAdapter != null && SelectionAdapter.ItemsSource != _view)
{
- SelectionAdapter.Items = _view;
+ SelectionAdapter.ItemsSource = _view;
}
if (IsDropDownOpen)
{
@@ -1545,9 +1545,9 @@ namespace Avalonia.Controls
{
// Significant changes to the underlying data.
ClearView();
- if (Items != null)
+ if (ItemsSource != null)
{
- _items = new List