зеркало из https://github.com/DeGsoft/maui-linux.git
[Design] Allow numeric values for FontSize (#2224)
This ensures that intellisense in Visual Studio does not report an error when numeric values are put in this property instead of the 'string' values like 'Small', 'Large' etc
This commit is contained in:
Родитель
d92fb98cc5
Коммит
ae7b80fe8c
|
@ -32,7 +32,7 @@ namespace Xamarin.Forms.Core.Design
|
|||
foreach (var fontElement in fontElements) {
|
||||
AddCallback (fontElement, builder => builder.AddCustomAttributes (
|
||||
"FontSize",
|
||||
new System.ComponentModel.TypeConverterAttribute (typeof (EnumConverter<NamedSize>))));
|
||||
new System.ComponentModel.TypeConverterAttribute (typeof (NonExclusiveEnumConverter<NamedSize>))));
|
||||
}
|
||||
|
||||
// TODO: OnPlatform/OnIdiom
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
using System.ComponentModel;
|
||||
|
||||
namespace Xamarin.Forms.Core.Design
|
||||
{
|
||||
internal class NonExclusiveEnumConverter<T> : EnumConverter<T>
|
||||
{
|
||||
public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -51,6 +51,7 @@
|
|||
<ItemGroup Condition=" '$(OS)' != 'Unix' ">
|
||||
<Compile Include="AttributeTableBuilder.cs" />
|
||||
<Compile Include="EnumConverter.cs" />
|
||||
<Compile Include="NonExclusiveEnumConverter.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="RegisterMetadata.cs" />
|
||||
</ItemGroup>
|
||||
|
|
Загрузка…
Ссылка в новой задаче