Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] Shell Navigation.PushAsync ignored on UWP platform #8498

Closed
curtisconner opened this issue Nov 14, 2019 · 46 comments
Closed

[Bug] Shell Navigation.PushAsync ignored on UWP platform #8498

curtisconner opened this issue Nov 14, 2019 · 46 comments

Comments

@curtisconner
Copy link

Description
Using the solution created by VS2019 for shell and then adding a UWP project to it does not work correctly, the call to Navigation.PushAsync to bring up the detail form is ignored but the same project works correctly with Android and iOS

Steps to Reproduce
Create a new solution with VS2019, select shell project for iOS and Android.
Add in the UWP project, update the UWP code for Xamarin as documented.
https://stackoverflow.com/questions/41192203/how-can-i-add-a-uwp-target-to-an-existing-xamarin-forms-project

Upgrade the Nuget for the project to use the 4.3 release of Xamarin.Forms

Add the line global::Xamarin.Forms.Forms.SetFlags("Shell_UWP_Experimental"); prior to calling Xamarin.Forms.Init

Compile and run in UWP mode

When the app runs select the "First item", this should then display a new page with the details of the first item. On UWP it does not, it stays on the same page. it seems that the line

await Navigation.PushAsync(new ItemDetailPage(new ItemDetailViewModel(item)));

is being ignored in UWP

Expected Behavior

I expected that when I selected the "First item" it would bring up the details page for this first item.

@curtisconner curtisconner added s/unverified New report that has yet to be verified t/bug 🐛 labels Nov 14, 2019
@hartez
Copy link
Contributor

hartez commented Nov 17, 2019

_8498 Repro.zip

@hartez hartez added a/shell 🐚 p/UWP e/5 🕔 5 and removed s/unverified New report that has yet to be verified labels Nov 17, 2019
@curtisconner
Copy link
Author

Guys, Curious if this is going to be fixed in the near future since it a basic need in the application, without the ability to navigate its hard to test more of the basic system

I notice it has a tag of e/5 but my other bug has an e/4. this bug is way more important than the other one by far

@curtisconner
Copy link
Author

8498_Repro.zip
Looks like the repro does not include a UWP project, I have updated it to include the UWP project

@curtisconner
Copy link
Author

Not sure why this got closed, sorry

@hartez
Copy link
Contributor

hartez commented Dec 2, 2019

I notice it has a tag of e/5 but my other bug has an e/4. this bug is way more important than the other one by far

@curtisconner The e tags are a very, very rough estimate of the effort required to fix the problem; it has nothing to do with the importance of the issue.

@DiagProf
Copy link

DiagProf commented Dec 7, 2019

Hello I am newbie to Xamarin.Forms. I think the shell is a great idea.
That's why I wanted to test it with UWP.
I checked out the following:
https://github.com/xamarin/xamarin-forms-samples/tree/master/UserInterface/Xaminals
and add UWP support, of course with experimental flag.
I still have to copy the pictures into UWP Project and then it looked like it works.
But I can’t navigate to a detail page, await Shell.Current.GoToAsync… does not seem to work under UWP.
In search of a solution, I ended up here. Now I do not know if my problem is the same. I am still too newbie.
Could one possibly tell me if I'm at the right bug?
Thanks!

@curtisconner
Copy link
Author

curtisconner commented Dec 7, 2019 via email

@curtisconner
Copy link
Author

Guys, I could use your help. I have modified the source from the 4.3 branch to get the basic navigation to work, it will now load a new page and show the back arrow. But when I try to implement the back button I get failure. Its seems that there is a need to create a new page not just use the frame.goback method. Not sure what's going on here.

My source is at https://github.com/curtisconner/Xamarin.Forms-UWP-Shell-Navigation and the changes can be found in the region commented under Navigation. all changes are in the Shell directory.

Any help would be great

@curtisconner
Copy link
Author

OK I guess no one is using this feature so I might as well just ignore it and use another platform. thanks

@MarinKos89
Copy link

I waiting two month for this fix :)

@Nioux
Copy link

Nioux commented Jan 14, 2020

So am I ;)

@danf25
Copy link

danf25 commented Jan 21, 2020

Yes it is very very important. You do a great job (really) but I think you underestimate UWP (tablet and especially desktop). With the arrival of Shells, UWP had a bad cold and we had to postpone a major version (we didn't think it would take as long to finish the job). So thank you for healing the UWP. Have a nice year.

@JogyBlack
Copy link
Contributor

I have the same problem. Navigation.PushAsync() does not work for the UWP project. Using Shell and updated to latest Xamarin Forms 4.4.0.991640

@samhouts
Copy link
Member

We're on it, friends. Sorry about the delay.

@danf25
Copy link

danf25 commented Jun 12, 2020

Thank very much. My team and I really appreciate. Have a nice weekend.

@Flexman
Copy link

Flexman commented Jun 13, 2020

@hartez @samhouts Can we get some answers here? Leaving UWP apps crippled for 7 months seems like a massive oversight.

Particularly when you factor in project re-union which is finally the right direction and one of the stacks to be merged is ignored.

@samhouts samhouts removed the 4.3.0 regression on 4.3.0 label Jun 15, 2020
@grantkiwi
Copy link

Do you have an ETA?

@grantkiwi
Copy link

I am using a UWP project and Xamarin.Forms (4.7.0.968). Navigation.PushAsync works first time but then freezes after that? Is this the same issue?

@PureWeen
Copy link
Contributor

PureWeen commented Jun 26, 2020

No ETA as of yet

The thing about this issue is that it's not really a bug. None of the navigation for Shell UWP is really built, so it's not just fixing an if statement. It's wiring up the back button, fixing the title, filling in all the other nav apis, switching flyout items maintains stack, etc..

I'm close to having the features of "push" done as the first functional step and then I'll create additional issues for the other parts that people can follow.

@grantkiwi
Copy link

So are you saying that you cannot use Xamarin.Forms with a UWP project??

@hartez
Copy link
Contributor

hartez commented Jun 26, 2020

No, he's saying that this particular feature of Forms is not yet fully implemented for UWP. Using Forms with UWP will work fine if you are not using this particular feature.

@hot33331
Copy link
Contributor

So if I understand correctly: you can use Xamarin Forms with UWP, the new feature, Shell is not yet fully implemented for UWP. So there are some options:

  1. do not use Shell until it works with UWP, use plain old Xamarin Forms which should work just fine
  2. wait until Shell is fully implemented for Xamarin Forms, then use it
  3. implement it yourself, be a hero and safe the day

Repeatedly asking are we there yet will not speed up the process, just make this ticket longer.

@g4mb10r
Copy link

g4mb10r commented Aug 7, 2020

Thanks team! Unfortunately, a lot changes in 8 months, and we have moved on to navigation routes. I.e. Shell.Current.GoToAsync, which doesn't work in UWP. Is there a bug open for this @samhouts @hartez? I can't find one.

@samhouts
Copy link
Member

@g4mb10r No, there isn't. Would you mind opening one? Thanks!!

@samhouts
Copy link
Member

closed by #11410

@filipoff2
Copy link

filipoff2 commented Aug 12, 2020

After update to "Xamarin.Forms" Version="4.8.0.1269"

Getting other exception on
ArgumentException: An item with the same key has already been added. Key: background

line 71:
rootFrame.Navigate(typeof(MainPage), e.Arguments);
In
https://github.com/filipoff2/MagicGradients/blob/issues/Add-UWP-Playground-Project-45/Playground/Playground.UWP/App.xaml.cs

Result:
On 4.8 App is crashing on start
On 4.5 navigation was not done.

@samhouts new issue?

@PureWeen
Copy link
Contributor

@filipoff2 yea if you can log a new issue so that we make sure it's not missed that would be helpful!!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests