Skip to content

Commit

Permalink
Add support for TypeConverter
Browse files Browse the repository at this point in the history
Fixes: #8493
Fixes: #9632
Fixes: #9339
Fixes: #8385
Fixes: 10077

This fix adds support for type converters as well as a few other minor
things we were missing from binding. The key thing about supporting
conversions is that we new can support arbitrary types with `@bind`.
This means you can use it with generics, which is something many users
have tried.

Along with type converters we get Guid and TimeSpan from the BCL. The
BCL also includes converters for types we're less interested in like
`short`.
  • Loading branch information
Ryan Nowak committed Jun 1, 2019
1 parent 6e35229 commit db88626
Show file tree
Hide file tree
Showing 6 changed files with 516 additions and 102 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,9 @@
<assembly fullname="System">
<!-- Without this, [Required(typeof(bool), "true", "true", ErrorMessage = "...")] fails -->
<type fullname="System.ComponentModel.BooleanConverter" />

<!-- TypeConverters are only used through reflection. These are two built-in TypeConverters that are useful. -->
<type fullname="System.ComponentModel.GuidConverter" />
<type fullname="System.ComponentModel.TimeSpanConverter" />
</assembly>
</linker>
Loading

1 comment on commit db88626

@arivoir
Copy link

@arivoir arivoir commented on db88626 Jun 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In EventCallbackFactoryBinderExtensions class it is parsing numbers using the CurrentCulture, and that can give different results depending on the machine where the app is ran. Shouldn't it use InvariantCulture?

Please sign in to comment.