Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BindableLayout.ItemsSource no longer works in 8.0.61 #23491

Open
Marcos-Jose-DV opened this issue Jul 9, 2024 · 11 comments
Open

BindableLayout.ItemsSource no longer works in 8.0.61 #23491

Marcos-Jose-DV opened this issue Jul 9, 2024 · 11 comments
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter i/regression This issue described a confirmed regression on a currently supported version platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working

Comments

@Marcos-Jose-DV
Copy link

Marcos-Jose-DV commented Jul 9, 2024

Description

After updating the Microsoft.Maui.Controls.Compatibility and Microsoft.Maui.Controls packages to version 8.0.61, a view of the BindableLayout.ItemsSource stopped working. The data linked to the binding was not configured correctly,

I went back to version 8.0.21 and resolved

  <Grid>
     <ScrollView>
         <FlexLayout>
             <!-- Header -->
             <VerticalStackLayout>
                 <Grid>
                     <BoxView BackgroundColor="#3255e2" HeightRequest="64"/>
                     <Label Text="Avaliações" FontSize="24"/>
                 </Grid>
                 <HorizontalStackLayout BackgroundColor="#202380" Padding="10">
                     <Button Text="Inicio"/>
                     <Button Text="Filmes" />
                     <Button Text="Séries"/>
                     <Button Text="Livros"/>
                     <Button Text="Musicas"/>
                 </HorizontalStackLayout>
             </VerticalStackLayout>


             <!-- Body -->
             <FlexLayout FlexLayout.Grow="1"
                         Wrap="Wrap"
                         JustifyContent="Start" 
                         BindableLayout.ItemsSource="{Binding Assessments}"
                         Margin="10"
                         ZIndex="4">

                 <!-- Content -->
                 <BindableLayout.ItemTemplate>
                     <DataTemplate>
                         <VerticalStackLayout>
                             <Frame CornerRadius="10"
                                    HasShadow="True"
                                    BorderColor="White"
                                    WidthRequest="160"
                                    HeightRequest="240"
                                    Padding="0"
                                    Margin="10">
                                 <Image Source="{Binding Image}"
                                    x:Name="ImageCard"
                                    Aspect="AspectFill"
                                    MaximumWidthRequest="160"
                                    MaximumHeightRequest="240">
                                     <Image.GestureRecognizers>
                                         <PointerGestureRecognizer PointerEntered="OnPointerEntered"
                                                                   PointerExited="OnPointerExited"/>

                                         <TapGestureRecognizer Command="{Binding BindingContext.DetailCommand,Source={x:Reference PaiPage}}"
                                                               CommandParameter="{Binding .}"/>
                                     </Image.GestureRecognizers>
                                 </Image>
                             </Frame>
                         </VerticalStackLayout>
                     </DataTemplate>
                 </BindableLayout.ItemTemplate>
             </FlexLayout>

         </FlexLayout>
     </ScrollView>
 </Grid>

Steps to Reproduce

  1. Updated the versions of the Microsoft.Maui.Controls and Microsoft.Maui.Controls.Compatibility packages to version 8.0.61.
  2. My FlexLayout layout was using BindableLayout.ItemsSource to bind the data.
  3. After updating, the data did not appear on the page, although it was context-bound.
  4. I went back to version 8.0.21 and everything is back to normal.

Link to public Reproduction project repository

No response

Version with bug

8.0.40

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

8.0.40

Affected platforms

Windows

Affected platform versions

windows 10.0.17763.0

Did you find any workaround?

No response

Relevant log output

I didn't have any way out
@Marcos-Jose-DV Marcos-Jose-DV added the t/bug Something isn't working label Jul 9, 2024
Copy link
Contributor

github-actions bot commented Jul 9, 2024

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@jfversluis jfversluis changed the title Issues with version of Microsoft.Maui.Controls.Compatibility and Microsoft.Maui.Controls packages to version 8.0.61 BindableLayout.ItemsSource no longer works in 8.0.61 Jul 9, 2024
@jfversluis jfversluis added area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter potential-regression This issue described a possible regression on a currently supported version., verification pending labels Jul 9, 2024
@PureWeen PureWeen added the s/needs-repro Attach a solution or code which reproduces the issue label Jul 9, 2024
@Marcos-Jose-DV
Copy link
Author

Marcos-Jose-DV commented Jul 9, 2024

Apparently when I use other layouts it works perfectly - Reproduction

With FlexLayout error (8.0.61)

 <Grid>
     <ScrollView>
         <FlexLayout>
             <!-- Header -->
             <VerticalStackLayout>
                 <Grid>
                     <BoxView BackgroundColor="#3255e2" HeightRequest="64"/>
                     <Label Text="Avaliações" FontSize="24"/>
                 </Grid>
                 <HorizontalStackLayout BackgroundColor="#202380" Padding="10">
                     <Button Text="Inicio"/>
                     <Button Text="Filmes" />
                     <Button Text="Séries"/>
                     <Button Text="Livros"/>
                     <Button Text="Musicas"/>
                 </HorizontalStackLayout>
             </VerticalStackLayout>


             <!-- Body -->
             <FlexLayout FlexLayout.Grow="1"
                         Wrap="Wrap"
                         JustifyContent="Start" 
                         BindableLayout.ItemsSource="{Binding Assessments}"
                         Margin="10"
                         ZIndex="4">

                 <!-- Content -->
                 <BindableLayout.ItemTemplate>
                     <DataTemplate>
                         <VerticalStackLayout>
                             <Frame CornerRadius="10"
                                    HasShadow="True"
                                    BorderColor="White"
                                    WidthRequest="160"
                                    HeightRequest="240"
                                    Padding="0"
                                    Margin="10">
                                 <Image Source="{Binding Image}"
                                    x:Name="ImageCard"
                                    Aspect="AspectFill"
                                    MaximumWidthRequest="160"
                                    MaximumHeightRequest="240">
                                     <Image.GestureRecognizers>
                                         <PointerGestureRecognizer PointerEntered="OnPointerEntered"
                                                                   PointerExited="OnPointerExited"/>

                                         <TapGestureRecognizer Command="{Binding BindingContext.DetailCommand,Source={x:Reference PaiPage}}"
                                                               CommandParameter="{Binding .}"/>
                                     </Image.GestureRecognizers>
                                 </Image>
                             </Frame>
                         </VerticalStackLayout>
                     </DataTemplate>
                 </BindableLayout.ItemTemplate>
             </FlexLayout>

         </FlexLayout>
     </ScrollView>
 </Grid>

With other layouts - Ok (8.0.61)

 <Grid>
     <ScrollView>
         <VerticalStackLayout>
             <!-- Header -->
             <VerticalStackLayout>
                 <Grid>
                     <BoxView BackgroundColor="#3255e2" HeightRequest="64"/>
                     <Label Text="Avaliações" FontSize="24"/>
                 </Grid>
                 <HorizontalStackLayout BackgroundColor="#202380" Padding="10">
                     <Button Text="Inicio"/>
                     <Button Text="Filmes" />
                     <Button Text="Séries"/>
                     <Button Text="Livros"/>
                     <Button Text="Musicas"/>
                 </HorizontalStackLayout>
             </VerticalStackLayout>


             <!-- Body -->
             <FlexLayout FlexLayout.Grow="1"
                         Wrap="Wrap"
                         JustifyContent="Start" 
                         BindableLayout.ItemsSource="{Binding Assessments}"
                         Margin="10"
                         ZIndex="4">

                 <!-- Content -->
                 <BindableLayout.ItemTemplate>
                     <DataTemplate>
                         <VerticalStackLayout>
                             <Frame CornerRadius="10"
                                    HasShadow="True"
                                    BorderColor="White"
                                    WidthRequest="160"
                                    HeightRequest="240"
                                    Padding="0"
                                    Margin="10">
                                 <Image Source="{Binding Image}"
                                    x:Name="ImageCard"
                                    Aspect="AspectFill"
                                    MaximumWidthRequest="160"
                                    MaximumHeightRequest="240">
                                     <Image.GestureRecognizers>
                                         <PointerGestureRecognizer PointerEntered="OnPointerEntered"
                                                                   PointerExited="OnPointerExited"/>

                                         <TapGestureRecognizer Command="{Binding BindingContext.DetailCommand,Source={x:Reference PaiPage}}"
                                                               CommandParameter="{Binding .}"/>
                                     </Image.GestureRecognizers>
                                 </Image>
                             </Frame>
                         </VerticalStackLayout>
                     </DataTemplate>
                 </BindableLayout.ItemTemplate>
             </FlexLayout>

         </VerticalStackLayout>
     </ScrollView>
 </Grid>

@dotnet-policy-service dotnet-policy-service bot added s/needs-attention Issue has more information and needs another look and removed s/needs-repro Attach a solution or code which reproduces the issue labels Jul 9, 2024
@Marcos-Jose-DV
Copy link
Author

Version 8.0.60 and 8.0.70 have the same behavior

@kevinxufei kevinxufei added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed and removed potential-regression This issue described a possible regression on a currently supported version., verification pending labels Jul 10, 2024
@kevinxufei
Copy link

This issue has been verified using Visual Studio 17.11.0 Preview 3.0(8.0.70 & 8.0.60). Can repro on Windows platform.

@PureWeen PureWeen added the i/regression This issue described a confirmed regression on a currently supported version label Jul 10, 2024
@PureWeen PureWeen added this to the .NET 8 SR8 milestone Jul 10, 2024
@PureWeen PureWeen self-assigned this Jul 10, 2024
@PureWeen PureWeen added potential-regression This issue described a possible regression on a currently supported version., verification pending and removed i/regression This issue described a confirmed regression on a currently supported version labels Aug 2, 2024
@PureWeen
Copy link
Member

PureWeen commented Aug 2, 2024

@kevinxufei can you go back MAUI versions and figure out what version it regressed on?

@PureWeen PureWeen removed their assignment Aug 2, 2024
@PureWeen PureWeen added s/needs-info Issue needs more info from the author and removed s/needs-attention Issue has more information and needs another look labels Aug 2, 2024
@PureWeen PureWeen modified the milestones: .NET 8 SR8, .NET 8 SR9 Aug 2, 2024
@kevinxufei
Copy link

@PureWeen It has been verified that 8.0.60 does not work, 8.0.40 works fine

@dotnet-policy-service dotnet-policy-service bot added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author labels Aug 5, 2024
@PureWeen PureWeen added the i/regression This issue described a confirmed regression on a currently supported version label Aug 9, 2024
@PureWeen PureWeen removed potential-regression This issue described a possible regression on a currently supported version., verification pending s/needs-attention Issue has more information and needs another look labels Aug 9, 2024
@mattleibow
Copy link
Member

I am not able to repro or at least not able to see what it should be.

Here is 8.0.40:
image

And this is the repo, untouched, at 8.0.70:
image

I even tested 8.0.61, and that worked fine. What is the result you see?

@Marcos-Jose-DV
Copy link
Author

When changing the FlexLayout parent by other Layout works all versions.

using FlexLayout in version 8.0.40.
summary, appears the body successfully.
versao 8 0 40

using FlexLayout in version 8.0.60.
summary, body does not appear.
versao 8 0 60

using FlexLayout in version 8.0.61.
summary, body does not appear.
versao 8 0 61

@Marcos-Jose-DV
Copy link
Author

Marcos-Jose-DV commented Aug 21, 2024

Apparently when I use other layouts it works perfectly - Reproduction
Code.

<FlexLayout Direction="Column">
    <!--  Header  -->
    <VerticalStackLayout>
        <Grid>
            <BoxView BackgroundColor="#3255e2" HeightRequest="64" />
            <Label FontSize="24" Text="Avaliações" />
        </Grid>
        <HorizontalStackLayout Padding="10" BackgroundColor="#202380">
            <Button Text="Inicio" />
            <Button Text="Filmes" />
            <Button Text="Séries" />
            <Button Text="Livros" />
            <Button Text="Musicas" />
        </HorizontalStackLayout>
    </VerticalStackLayout>

    <!--  Body  -->
    <FlexLayout
        Margin="10"
        BindableLayout.ItemsSource="{Binding Assessments}"
        FlexLayout.Grow="1"
        JustifyContent="Start"
        Wrap="Wrap"
        ZIndex="4">

        <!--  Content  -->
        <BindableLayout.ItemTemplate>
            <DataTemplate>
                <VerticalStackLayout>
                    <Frame
                        Margin="10"
                        Padding="0"
                        BorderColor="White"
                        CornerRadius="10"
                        HasShadow="True"
                        HeightRequest="240"
                        WidthRequest="160">
                        <Image
                            x:Name="ImageCard"
                            Aspect="AspectFill"
                            MaximumHeightRequest="240"
                            MaximumWidthRequest="160"
                            Source="{Binding Image}">
                            <Image.GestureRecognizers>
                                <PointerGestureRecognizer PointerEntered="OnPointerEntered" PointerExited="OnPointerExited" />

                                <TapGestureRecognizer Command="{Binding BindingContext.DetailCommand, Source={x:Reference PaiPage}}" CommandParameter="{Binding .}" />
                            </Image.GestureRecognizers>
                        </Image>
                    </Frame>
                </VerticalStackLayout>
            </DataTemplate>
        </BindableLayout.ItemTemplate>
    </FlexLayout>
</FlexLayout>

@mattleibow
Copy link
Member

But I ran the attached sample app and that is where I got the screenshots.

Is the sample app using flex not correct repro, or is it my machine?

Can you attach a binlog so I can check what is happening in the build?

@Marcos-Jose-DV
Copy link
Author

Marcos-Jose-DV commented Aug 22, 2024

Which way do you prefer shipping? I don't know about zip and the correct way.
I can also send it as a txt file.
BinLog binlog.zip

@PureWeen PureWeen modified the milestones: .NET 8 SR9, .NET 9 Servicing Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter i/regression This issue described a confirmed regression on a currently supported version platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

6 participants