"ItemsLayout",
new System.ComponentModel.TypeConverterAttribute(typeof(ItemsLayoutDesignTypeConverter))));
+ AddCallback(typeof(InputView), builder => builder.AddCustomAttributes(
+ nameof(Keyboard),
+ new System.ComponentModel.TypeConverterAttribute(typeof(KeyboardDesignTypeConverter))));
+
+ AddCallback(typeof(EntryCell), builder => builder.AddCustomAttributes(
+ nameof(Keyboard),
+ new System.ComponentModel.TypeConverterAttribute(typeof(KeyboardDesignTypeConverter))));
+
// 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.
--- /dev/null
+namespace Xamarin.Forms.Core.Design
+{
+ using System.Linq;
+ using System.ComponentModel;
+ using System;
+ using System.Reflection;
+
+ public class KeyboardDesignTypeConverter : TypeConverter
+ {
+ public KeyboardDesignTypeConverter()
+ {
+ }
+
+ 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 props = typeof(Keyboard)
+ .GetProperties(BindingFlags.Static | BindingFlags.Public)
+ .Where(p => p.CanRead)
+ .Select(p => p.Name)
+ .ToArray();
+ Values = new StandardValuesCollection(props);
+ }
+
+ return Values;
+ }
+
+ public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
+ {
+ return false;
+ }
+
+ public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
+ {
+ return true;
+ }
+ }
+}
\ No newline at end of file
</ItemGroup>
<ItemGroup>
<Compile Include="ItemsLayoutDesignTypeConverter.cs" />
+ <Compile Include="KeyboardDesignTypeConverter.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- Ensure that all images in the 'mac' and 'win' subdirectories are included as embedded resources -->