diff --git a/.nuspec/Xamarin.Forms.Android.targets b/.nuspec/Xamarin.Forms.Android.targets
index c4aa59a9e..eaa7ac058 100644
--- a/.nuspec/Xamarin.Forms.Android.targets
+++ b/.nuspec/Xamarin.Forms.Android.targets
@@ -2,4 +2,12 @@
+
+
+ 8.1
+ $(TargetFrameworkVersion.TrimStart('vV'))
+
+
+
diff --git a/.nuspec/Xamarin.Forms.Visual.Material.targets b/.nuspec/Xamarin.Forms.Visual.Material.targets
index c5c94c81a..4b0919d88 100644
--- a/.nuspec/Xamarin.Forms.Visual.Material.targets
+++ b/.nuspec/Xamarin.Forms.Visual.Material.targets
@@ -1,5 +1,5 @@
-
+
9.0
$(TargetFrameworkVersion.TrimStart('vV'))
diff --git a/Xamarin.Forms.Controls/CoreGallery.cs b/Xamarin.Forms.Controls/CoreGallery.cs
index 45f7e4454..477c53c28 100644
--- a/Xamarin.Forms.Controls/CoreGallery.cs
+++ b/Xamarin.Forms.Controls/CoreGallery.cs
@@ -321,8 +321,8 @@ namespace Xamarin.Forms.Controls
new GalleryPageFactory(() => new OpenGLViewCoreGalleryPage(), "OpenGLView Gallery"),
new GalleryPageFactory(() => new PickerCoreGalleryPage(), "Picker Gallery"),
new GalleryPageFactory(() => new ProgressBarCoreGalleryPage(), "ProgressBar Gallery"),
- new GalleryPageFactory(() => new MaterialProgressBarGallery(), "[Material] ProgressBar & Slider Gallery"),
- new GalleryPageFactory(() => new MaterialActivityIndicatorGallery(), "[Material] ActivityIndicator Gallery"),
+ new GalleryPageFactory(() => new MaterialProgressBarGallery(), "ProgressBar & Slider Gallery (Material)"),
+ new GalleryPageFactory(() => new MaterialActivityIndicatorGallery(), "ActivityIndicator Gallery (Material)"),
new GalleryPageFactory(() => new ScrollGallery(), "ScrollView Gallery"),
new GalleryPageFactory(() => new ScrollGallery(ScrollOrientation.Horizontal), "ScrollView Gallery Horizontal"),
new GalleryPageFactory(() => new ScrollGallery(ScrollOrientation.Both), "ScrollView Gallery 2D"),
diff --git a/Xamarin.Forms.Core.Design/AttributeTableBuilder.cs b/Xamarin.Forms.Core.Design/AttributeTableBuilder.cs
index 16ecc1c8c..69b256343 100644
--- a/Xamarin.Forms.Core.Design/AttributeTableBuilder.cs
+++ b/Xamarin.Forms.Core.Design/AttributeTableBuilder.cs
@@ -35,6 +35,10 @@ namespace Xamarin.Forms.Core.Design
new System.ComponentModel.TypeConverterAttribute (typeof (NonExclusiveEnumConverter))));
}
+ AddCallback(typeof(VisualElement), builder => builder.AddCustomAttributes(
+ "Visual",
+ new System.ComponentModel.TypeConverterAttribute(typeof(VisualDesignTypeConverter))));
+
// TODO: OnPlatform/OnIdiom
// These two should be proper markup extensions, to follow WPF syntax for those.
// That would allow us to turn on XAML validation, which otherwise fails.
@@ -42,7 +46,7 @@ namespace Xamarin.Forms.Core.Design
// the language service can find the type by its name. That class can be internal
// though, since its visibility in the markup is controlled by the EditorBrowsableAttribute.
// Make OnPlatform/OnIdiom visible for intellisense, and set as markup extension.
- AddCallback (typeof (OnPlatform<>), builder => builder.AddCustomAttributes (new Attribute[] {
+ AddCallback(typeof (OnPlatform<>), builder => builder.AddCustomAttributes (new Attribute[] {
new EditorBrowsableAttribute (EditorBrowsableState.Always),
//new System.ComponentModel.TypeConverterAttribute(typeof(AnythingConverter)),
//new System.Windows.Markup.MarkupExtensionReturnTypeAttribute (),
diff --git a/Xamarin.Forms.Core.Design/VisualDesignTypeConverter.cs b/Xamarin.Forms.Core.Design/VisualDesignTypeConverter.cs
new file mode 100644
index 000000000..67f89503d
--- /dev/null
+++ b/Xamarin.Forms.Core.Design/VisualDesignTypeConverter.cs
@@ -0,0 +1,64 @@
+namespace Xamarin.Forms.Core.Design
+{
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.ComponentModel;
+ using System;
+
+ public class VisualDesignTypeConverter : TypeConverter
+ {
+ public VisualDesignTypeConverter()
+ {
+ }
+
+ protected StandardValuesCollection Values
+ {
+ get;
+ set;
+ }
+
+ public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
+ {
+ // This tells XAML this converter can be used to process strings
+ // Without this the values won't show up as hints
+ if (sourceType == typeof(string))
+ return true;
+
+ return base.CanConvertFrom(context, sourceType);
+ }
+
+ public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
+ {
+ if(Values == null)
+ {
+ var derivedNames = new List();
+ var baseType = typeof(IVisual);
+
+ var typeElements = typeof(View).Assembly.ExportedTypes.Where(t => baseType.IsAssignableFrom(t) && t.Name != baseType.Name);
+
+ foreach (var typeElement in typeElements)
+ {
+ string name = typeElement.Name;
+ if (name.EndsWith("Visual", StringComparison.OrdinalIgnoreCase))
+ name = name.Substring(0, name.Length - 6);
+
+ derivedNames.Add(name);
+ }
+
+ Values = new StandardValuesCollection(derivedNames);
+ }
+
+ return Values;
+ }
+
+ public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
+ {
+ return false;
+ }
+
+ public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
+ {
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Xamarin.Forms.Core.Design/Xamarin.Forms.Core.Design.csproj b/Xamarin.Forms.Core.Design/Xamarin.Forms.Core.Design.csproj
index 9343c2192..21c871f1f 100644
--- a/Xamarin.Forms.Core.Design/Xamarin.Forms.Core.Design.csproj
+++ b/Xamarin.Forms.Core.Design/Xamarin.Forms.Core.Design.csproj
@@ -50,6 +50,7 @@
Properties\GlobalAssemblyInfo.cs
+
diff --git a/Xamarin.Forms.Core.UnitTests/BindableLayoutTests.cs b/Xamarin.Forms.Core.UnitTests/BindableLayoutTests.cs
index 60532c971..e2a6ddcab 100644
--- a/Xamarin.Forms.Core.UnitTests/BindableLayoutTests.cs
+++ b/Xamarin.Forms.Core.UnitTests/BindableLayoutTests.cs
@@ -1,8 +1,10 @@
using NUnit.Framework;
using System;
using System.Collections;
+using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
+using System.ComponentModel;
using System.Linq;
namespace Xamarin.Forms.Core.UnitTests
@@ -72,6 +74,21 @@ namespace Xamarin.Forms.Core.UnitTests
Assert.IsTrue(IsLayoutWithItemsSource(itemsSource, layout));
}
+ [Test]
+ public void TracksRemoveAll()
+ {
+ var layout = new StackLayout
+ {
+ IsPlatformEnabled = true,
+ };
+
+ var itemsSource = new ObservableRangeCollection(Enumerable.Range(0, 10));
+ BindableLayout.SetItemsSource(layout, itemsSource);
+
+ itemsSource.RemoveAll();
+ Assert.IsTrue(IsLayoutWithItemsSource(itemsSource, layout));
+ }
+
[Test]
public void TracksReplace()
{
@@ -377,6 +394,27 @@ namespace Xamarin.Forms.Core.UnitTests
}
}
+ class ObservableRangeCollection : ObservableCollection
+ {
+ public ObservableRangeCollection(IEnumerable collection)
+ : base(collection)
+ {
+ }
+
+ public void RemoveAll()
+ {
+ CheckReentrancy();
+
+ var changedItems = new List(Items);
+ foreach (var i in changedItems)
+ Items.Remove(i);
+
+ OnPropertyChanged(new PropertyChangedEventArgs("Count"));
+ OnPropertyChanged(new PropertyChangedEventArgs("Item[]"));
+ OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, changedItems, 0));
+ }
+ }
+
class MyDataTemplateSelectorTest : DataTemplateSelector
{
readonly Func