dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.28k stars 1.76k forks source link

[ImageButton] VisualStateGroup crash app to break in release mode #13259

Open Strypper opened 1 year ago

Strypper commented 1 year ago

Description

I tried out the ImageButton with the visual state on Microsoft Document Debug mode: Run fine without an issue Release mode: Cause app to break

<ImageButton
                            HeightRequest="100"
                            Source="windowslogo.png"
                            WidthRequest="100">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal">
                                        <VisualState.Setters>
                                            <Setter Property="Scale" Value="1" />
                                        </VisualState.Setters>
                                    </VisualState>
                                    <VisualState x:Name="Pressed">
                                        <VisualState.Setters>
                                            <Setter Property="Scale" Value="0.8" />
                                        </VisualState.Setters>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                        </ImageButton>

Steps to Reproduce

<ImageButton
                            HeightRequest="100"
                            Source="windowslogo.png"
                            WidthRequest="100">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal">
                                        <VisualState.Setters>
                                            <Setter Property="Scale" Value="1" />
                                        </VisualState.Setters>
                                    </VisualState>
                                    <VisualState x:Name="Pressed">
                                        <VisualState.Setters>
                                            <Setter Property="Scale" Value="0.8" />
                                        </VisualState.Setters>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                        </ImageButton>

Link to public reproduction project repository

https://github.com/Strypper/mauisland

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android, Windows

Affected platform versions

Windows 11 Android 11

Did you find any workaround?

No

Relevant log output

I don't see anything log out from output
ghost commented 1 year ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

KarthikRajaKalaimani commented 1 year ago

any updates on this ?

KarthikRajaKalaimani commented 1 year ago

I'm facing the same in Grid.

XamlTest commented 1 year ago

Verified this on Visual Studio Enterprise 17.7.0 Preview 2.0. Repro on Windows 11 and Android 13.0-API33 with below Project: mauisland.zip

Pipozor commented 4 months ago

I confirm the immediate application crash on platform/windows with MAUI and net8.0-windows10.0.19041.0

Sample XAML:

            <HorizontalStackLayout HorizontalOptions="Center">
                <ImageButton
                x:Name="ButtonBookmark"

                Source="bookmark_off.png"
                Clicked="OnButtonBookmarkClicked"
                MaximumHeightRequest="100">

                <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CommonStates">
                        <VisualState x:Name="PointerOver">
                            <VisualState.Setters>
                                <Setter Property="Scale" Value="2" />
                            </VisualState.Setters>
                        </VisualState>
                    </VisualStateGroup>
                </VisualStateManager.VisualStateGroups>

                </ImageButton>
            </HorizontalStackLayout>