-
Notifications
You must be signed in to change notification settings - Fork 1.9k
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Bug] XF 4.8 pre2 - fix provided in #11187 - for RECT API throws error - System.InvalidOperationException Message=The BindableProperty "Width" is readonly. #11551
Comments
I believe this is addressed in #11548 |
reopening for the issue outlined at #11541 (comment), and rephrasing the content. the original issue (invalid IL) has been fixed |
@IoTFier do you really mean |
LayoutBounds property type should probably be changed to Rect instead of Rectangle |
I have updated step # 3 in the steps to reproduce. I had the WidthRequest and HeightRequest in place when I had tried to use it with 4.7 pre4 and 4.7 stable. But now, I am back to using The Rectangle struct up until 4.7 pre3 allowed these bindable property to be editable. Now in the new Rect API it is not allowed. I am going reiterate my request to all XF leadership panel to consider isolating Shapes API in its own namespace. |
they are no BP, but should be editable (they have a public setter)
Thanks for the recommandation, but this ship has sailed (the API has been in a public release). We can still consider moving it out while moving to Maui |
I tried to reproduce your issue with the following XAML: <?xml version="1.0" encoding="UTF-8"?>
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Xamarin.Forms.Xaml.UnitTests.Gh11551">
<ContentPage.Resources>
<Rect x:Key="rect" Height="22" Width="{x:Static AbsoluteLayout.AutoSize}" X="1" Y="0.5"/>
</ContentPage.Resources>
<Label x:Name="label">
<Label.Style>
<Style TargetType="Label">
<Setter Property="AbsoluteLayout.LayoutBounds" Value="{DynamicResource rect}"/>
</Style>
</Label.Style>
</Label>
</ContentPage> The message I suppose you still have some Rect/Rectangle mixups in your code. We understand this comes from a breaking change we introduced, and we're sorry for the inconvenience it causes to you and your project. I'm going to:
If you think it's not fixed, please reopen the issue, and attach a reproduction sample we can run. Thanks |
Hi @StephaneDelcroix , I guess my bin/obj folders were corrupt. Thank you all for helping me out. Thank you |
Description
Fix provided in #11187 throws error at runtime.
Steps to Reproduce
<Rect x:Key="TemplateLayoutBounds" Height="22" Width="{x:Static AbsoluteLayout.AutoSize}" X="1" Y="0.5" />
<Setter Property="AbsoluteLayout.LayoutBounds" Value="{DynamicResource TemplateLayoutBounds}" />
Please note this was working using struct API Rectangle - up until XF 4.7 pre3. It was broken in XF 4.7 pre4 until now.
Expected Behavior
Functionality of the Rectangle API up until 4.7 pre3 to be working in XF 4.8 pre2
Actual Behavior
Fix provided in #11187 is broken
Basic Information
Both Android and iOS
Reproduction Link
Workaround
The text was updated successfully, but these errors were encountered: