Closed kevkov closed 1 year ago
Oh, I think I see the issue here. When set with the wrong data type, the bindable property ignores the new value without any warnings.
@kevkov Adding a new defineBindableFloat32
is definitely the right way to go for this.
@kevkov I've released a new version of Fabulous with the PR you did so we can continue this PR :) https://www.nuget.org/packages/Fabulous/2.3.0
To be able to target this new version, you'll need to bump the version in several places:
The version bounds used by the Fabulous.XamarinForms package on NuGet https://github.com/fabulous-dev/Fabulous.XamarinForms/blob/main/src/Fabulous.XamarinForms/Fabulous.XamarinForms.fsproj#L143
The version used by the samples https://github.com/fabulous-dev/Fabulous.XamarinForms/blob/main/Directory.Packages.props#L8
The version used by the VS-win template https://github.com/fabulous-dev/Fabulous.XamarinForms/blob/main/templates/content/blank-vswin/.template.config/template.json#L58
The other template uses Fabulous as a transitive dependency, so we don't need to update it.
Updated as required I hope.
The following view code adapted from the Counter example
does not set the corner radius on the Frame:
With the changes in this PR (and changing the corner radius value to 50.f) the Frame corner radius is set:
I found that if the value was narrowed to a float32 in
defineSmallBindable
then the corner radius was set as expected:If the value is changed to a float then the corner radius is not set.
I did not establish why XF does not accept the value as a float.
The PR contains codecs for float32 which should possibly be in the Fabulous core project?
Note: there are only 4 properties in XF that are of type C# float/F# float32.