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.21k stars 1.75k forks source link

[regression/6.0.486] SwipeView Open/Close Programmatically on Windows does not Work #14777

Open fathi0amir opened 1 year ago

fathi0amir commented 1 year ago

Description

The sample program on the .NET MAUI repository for controlling the SwipeView open or close behavior programmatically (with a button) does not behave as expected. When the sample program is targeted on Android the two button (Open / Close) when pressed, open and close the SwipeView. However, when a windows machine is targeted, the buttons do not have the expected behavior (like the Android target).

Steps to Reproduce

Compile the SwipeViewDemos for Windows and in the app head to "Swipe Open and Close Demo" page. The SwipeView can be opened using a touchpad (swiping right) but the button (Open) doesn't open the view.

SwipViewDemos is here: https://github.com/dotnet/maui-samples/tree/main/6.0/UserInterface/Views/SwipeViewDemos

Link to public reproduction project repository

https://github.com/dotnet/maui-samples/tree/main/6.0/UserInterface/Views/SwipeViewDemos

Version with bug

6.0.486

Last version that worked well

6.0.424

Affected platforms

Windows

Affected platform versions

Windows 10.0.19041.0

Did you find any workaround?

No

Relevant log output

No response

ghost commented 1 year ago

Hi @fathi0amir. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.

You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

ghost commented 1 year ago

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

fathi0amir commented 1 year ago

Additionally, I tested the SwipeViewDemo in Visual Studio 17.5.4 and got the same unexpected behavior. I also changed the .NET version to 7.0 which also gave the same unexpected behavior. The unexpected behavior would be, in this case, the "Open" or "Close" button does not open or close the swipe view.

I am installing the preview version of Visual Studio and testing the demo with all the latest updates.

fathi0amir commented 1 year ago

I can confirm the issue persists in the latest preview version of Visual Studio.

jsuarezruiz commented 1 year ago

The SwipeView use the SwipeControl in Windows https://learn.microsoft.com/en-us/windows/winui/api/microsoft.ui.xaml.controls.swipecontrol?view=winui-2.8 The native control has an implementation to close programmatically but not to open. Currently the SwipeView in Windows can programmatically close but not open. It is not a regression, but it does require implementation.

bvdalling commented 1 year ago

I can confirm this is still an issue. I just used #if Windows #endif if to display an ActionSheet as a work around. Is this something we can expect to be resolved in .NET 8?

Zhanglirong-Winnie commented 10 months ago

Verified this issue with Visual Studio Enterprise 17.9.0 Preview 2. Can repro on windows platform with sample project. https://github.com/dotnet/maui-samples/tree/main/8.0/UserInterface/Views/SwipeViewDemos