XamlBindingHelper not returning right values #18855
Labels
difficulty/starter 🚀
Categorizes an issue for which the difficulty level is reachable by newcomers
kind/bug
Something isn't working
project/core-tools 🛠️
Categorizes an issue or PR as relevant to core and tools
Description
When using
XamlBindingHelper.Convert()
to test the conversion of specific structures, there are noticeable behavioral differences between Windows (WinUI) and Uno. The expected behavior is that conversion of structures to string usingConvert(typeof(string), value)
should produce a format similar to.ToString()
and should also support reconversion back to the original structure.Below is a comparison table showing results on each platform and reconversion support for Uno:
Matrix(1, 2, 3, 4, 5, 6)
1,2,3,4,5,6
1,2,3,4,5,6
Thickness(1, 2, 3, 4)
1,2,3,4
[Thickness: 1-2-3-4]
CornerRadius(1,2,3,4)
1,2,3,4
TopLeft: 1, TopRight: 2, BottomRight: 3, BottomLeft: 4
Duration(TimeSpan.FromSeconds(1))
00:00:01
00:00:01
Duration.Automatic
Automatic
Automatic
Duration.Forever
Forever
Forever
GridLength(1, GridUnitType.Auto)
Auto
Auto
GridLength(1, GridUnitType.Star)
1*
*
GridLength(1.5, GridUnitType.Star)
1.5*
1.5*
GridLength(1, GridUnitType.Pixel)
1
1.0px
GridLength(1.5, GridUnitType.Pixel)
1.5
1.5px
Point(1, 2)
1,2
[1, 2]
Rect(1, 2, 3, 4)
1,2,3,4
1,2,3,4
Size(1, 2)
1,2
1,2
Color
(Colors.Beige
)#FFF5F5DC
#FFF5F5DC
Issues to Address
Thickness
andCornerRadius
do not support reconversion to the original structure on Uno.Point
results in a different format ([1, 2]
) on Uno and does not support reconversion.GridLength
with pixel unit (1
vs1.0px
).The goal is for Uno to properly support reconversion to the original structure, and ideally, to align output format with Windows (though this is less critical).
Expected behavior
Uno should be able to convert forward and convert backward to string for those structs. (to and from
string
).How to reproduce it (as minimally and precisely as possible)
No response
Workaround
Not using the
XamlBindingHelper
Works on UWP/WinUI
Yes
The text was updated successfully, but these errors were encountered: