summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core/TemplatedItemsList.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Core/TemplatedItemsList.cs')
-rw-r--r--Xamarin.Forms.Core/TemplatedItemsList.cs35
1 files changed, 32 insertions, 3 deletions
diff --git a/Xamarin.Forms.Core/TemplatedItemsList.cs b/Xamarin.Forms.Core/TemplatedItemsList.cs
index a954939..e132d04 100644
--- a/Xamarin.Forms.Core/TemplatedItemsList.cs
+++ b/Xamarin.Forms.Core/TemplatedItemsList.cs
@@ -8,15 +8,17 @@ using System.Threading.Tasks;
using Cadenza.Collections;
using Xamarin.Forms.Internals;
-namespace Xamarin.Forms
+namespace Xamarin.Forms.Internals
{
- internal sealed class TemplatedItemsList<TView, TItem> : BindableObject, ITemplatedItemsList<TItem>, IList, IDisposable
+ public sealed class TemplatedItemsList<TView, TItem> : BindableObject, ITemplatedItemsList<TItem>, IList, IDisposable
where TView : BindableObject, IItemsView<TItem>
where TItem : BindableObject
{
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static readonly BindableProperty NameProperty = BindableProperty.Create("Name", typeof(string), typeof(TemplatedItemsList<TView, TItem>), null);
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static readonly BindableProperty ShortNameProperty = BindableProperty.Create("ShortName", typeof(string), typeof(TemplatedItemsList<TView, TItem>), null);
static readonly BindablePropertyKey HeaderContentPropertyKey = BindableProperty.CreateReadOnly("HeaderContent", typeof(TItem), typeof(TemplatedItemsList<TView, TItem>), null);
@@ -94,6 +96,7 @@ namespace Xamarin.Forms
remove { PropertyChanged -= value; }
}
+ [EditorBrowsable(EditorBrowsableState.Never)]
public BindingBase GroupDisplayBinding
{
get { return _groupDisplayBinding; }
@@ -104,6 +107,7 @@ namespace Xamarin.Forms
}
}
+ [EditorBrowsable(EditorBrowsableState.Never)]
public DataTemplate GroupHeaderTemplate
{
get
@@ -125,8 +129,10 @@ namespace Xamarin.Forms
}
}
+ [EditorBrowsable(EditorBrowsableState.Never)]
public BindableProperty GroupHeaderTemplateProperty { get; set; }
+ [EditorBrowsable(EditorBrowsableState.Never)]
public BindingBase GroupShortNameBinding
{
get { return _groupShortNameBinding; }
@@ -137,40 +143,49 @@ namespace Xamarin.Forms
}
}
+ [EditorBrowsable(EditorBrowsableState.Never)]
public TItem HeaderContent
{
get { return (TItem)GetValue(HeaderContentPropertyKey.BindableProperty); }
private set { SetValue(HeaderContentPropertyKey, value); }
}
+ [EditorBrowsable(EditorBrowsableState.Never)]
public bool IsGroupingEnabled
{
get { return (IsGroupingEnabledProperty != null) && (bool)_itemsView.GetValue(IsGroupingEnabledProperty); }
}
+ [EditorBrowsable(EditorBrowsableState.Never)]
public BindableProperty IsGroupingEnabledProperty { get; set; }
+ [EditorBrowsable(EditorBrowsableState.Never)]
public IEnumerable ItemsSource
{
get { return ListProxy.ProxiedEnumerable; }
}
+ [EditorBrowsable(EditorBrowsableState.Never)]
public string Name
{
get { return (string)GetValue(NameProperty); }
set { SetValue(NameProperty, value); }
}
+ [EditorBrowsable(EditorBrowsableState.Never)]
public TemplatedItemsList<TView, TItem> Parent { get; }
+ [EditorBrowsable(EditorBrowsableState.Never)]
public BindableProperty ProgressiveLoadingProperty { get; set; }
+ [EditorBrowsable(EditorBrowsableState.Never)]
public string ShortName
{
get { return (string)GetValue(ShortNameProperty); }
set { SetValue(ShortNameProperty, value); }
}
+ [EditorBrowsable(EditorBrowsableState.Never)]
public IReadOnlyList<string> ShortNames
{
get { return _shortNames; }
@@ -324,18 +339,22 @@ namespace Xamarin.Forms
throw new NotSupportedException();
}
+ [EditorBrowsable(EditorBrowsableState.Never)]
public event NotifyCollectionChangedEventHandler CollectionChanged;
+ [EditorBrowsable(EditorBrowsableState.Never)]
public int Count
{
get { return ListProxy.Count; }
}
+ [EditorBrowsable(EditorBrowsableState.Never)]
public TItem this[int index]
{
get { return GetOrCreateContent(index, ListProxy[index]); }
}
+ [EditorBrowsable(EditorBrowsableState.Never)]
public int GetDescendantCount()
{
if (!IsGroupingEnabled)
@@ -351,6 +370,7 @@ namespace Xamarin.Forms
return count;
}
+ [EditorBrowsable(EditorBrowsableState.Never)]
public int GetGlobalIndexForGroup(ITemplatedItemsList<TItem> group)
{
if (group == null)
@@ -365,6 +385,7 @@ namespace Xamarin.Forms
return index;
}
+ [EditorBrowsable(EditorBrowsableState.Never)]
public int GetGlobalIndexOfGroup(object item)
{
var count = 0;
@@ -381,6 +402,7 @@ namespace Xamarin.Forms
return -1;
}
+ [EditorBrowsable(EditorBrowsableState.Never)]
public int GetGlobalIndexOfItem(object item)
{
if (!IsGroupingEnabled)
@@ -404,6 +426,7 @@ namespace Xamarin.Forms
return -1;
}
+ [EditorBrowsable(EditorBrowsableState.Never)]
public int GetGlobalIndexOfItem(object group, object item)
{
if (!IsGroupingEnabled)
@@ -430,6 +453,7 @@ namespace Xamarin.Forms
return -1;
}
+ [EditorBrowsable(EditorBrowsableState.Never)]
public Tuple<int, int> GetGroupAndIndexOfItem(object item)
{
if (item == null)
@@ -453,6 +477,7 @@ namespace Xamarin.Forms
return new Tuple<int, int>(-1, -1);
}
+ [EditorBrowsable(EditorBrowsableState.Never)]
public Tuple<int, int> GetGroupAndIndexOfItem(object group, object item)
{
if (!IsGroupingEnabled)
@@ -481,6 +506,7 @@ namespace Xamarin.Forms
return new Tuple<int, int>(-1, -1);
}
+ [EditorBrowsable(EditorBrowsableState.Never)]
public int GetGroupIndexFromGlobal(int globalIndex, out int leftOver)
{
leftOver = 0;
@@ -506,6 +532,7 @@ namespace Xamarin.Forms
return -1;
}
+ [EditorBrowsable(EditorBrowsableState.Never)]
public event NotifyCollectionChangedEventHandler GroupedCollectionChanged;
event NotifyCollectionChangedEventHandler ITemplatedItemsList<TItem>.GroupedCollectionChanged
{
@@ -513,6 +540,7 @@ namespace Xamarin.Forms
remove { GroupedCollectionChanged -= value; }
}
+ [EditorBrowsable(EditorBrowsableState.Never)]
public int IndexOf(TItem item)
{
TemplatedItemsList<TView, TItem> group = GetGroup(item);
@@ -522,7 +550,8 @@ namespace Xamarin.Forms
return GetIndex(item);
}
- internal TItem CreateContent(int index, object item, bool insert = false)
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public TItem CreateContent(int index, object item, bool insert = false)
{
TItem content = ItemTemplate != null ? (TItem)ItemTemplate.CreateContent(item, _itemsView) : _itemsView.CreateDefault(item);