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

Added Shell parameters #12465

Closed
wants to merge 25 commits into from
Closed

Added Shell parameters #12465

wants to merge 25 commits into from

Conversation

pictos
Copy link
Contributor

@pictos pictos commented Oct 13, 2020

Description of Change

This PR adds support for users passes complex data in Shell navigation with the new object ShellParameter.

Issues Resolved

API Changes

Added:

  • Shell.GoToAsync(ShellNavigationState state, IDictionary<string,object> parameters)
  • Shell.GoToAsync(ShellNavigationState state, bool animated, IDictionary<string,object> parameters)

Platforms Affected

  • Core/XAML (all platforms)

Behavioral/Visual Changes

None

Before/After Screenshots

Not applicable

Testing Procedure

When you navigate with Shell you can pass ShellParameter in the method, just like:

await Shell.Current.GoToAsync("//myAwesomeUri", new Dictionary { {"My key", someObj} });

PR Checklist

  • Targets the correct branch
  • Tests are passing (or failures are unrelated)

Xamarin.Forms.Core/Shell/ShellParameter.cs Outdated Show resolved Hide resolved
Xamarin.Forms.Core/Shell/ShellParameter.cs Outdated Show resolved Hide resolved
Xamarin.Forms.Core/Shell/Shell.cs Outdated Show resolved Hide resolved
@StephaneDelcroix
Copy link
Member

this removes the ability of serializing navigation Uris to strings (for, e.g., deep linking). I'd be more confortable if this was a Dictionary<string,string>

@StephaneDelcroix
Copy link
Member

  • This obsoletes the IQueryAttributable interface that no one uses because it's not documented anywhere

that's a lame excuse for obsoleting :)

@PureWeen
Copy link
Contributor

Apologies on this one @pictos

I gave you premature guidance on this one and as it currently stands we can't really take in an API change like this pre .NET MAUI

@PureWeen PureWeen closed this Oct 19, 2020
@samhouts samhouts added this to In Progress in vNext+1 (5.0.0) Nov 2, 2020
@PureWeen PureWeen moved this from In Progress to Done in vNext+1 (5.0.0) Nov 3, 2020
@PureWeen PureWeen reopened this Nov 27, 2020
vNext+1 (5.0.0) automation moved this from Done to To do Nov 27, 2020
@PureWeen PureWeen added this to In progress in v5.0.1 via automation Nov 27, 2020
@PureWeen PureWeen removed this from To do in vNext+1 (5.0.0) Nov 27, 2020
@PureWeen PureWeen added this to the 5.0.1 milestone Nov 27, 2020
@PureWeen PureWeen added the blocker Issue blocks next stable release. Prioritize fixing and reviewing this issue. label Nov 27, 2020
@PureWeen
Copy link
Contributor

PureWeen commented Dec 1, 2020

/azp run

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

rmarinho and others added 21 commits December 29, 2020 20:48
… of CollectionView (xamarin#12823) fixes xamarin#9282

* Handle selected background color updates after cell is added as child of CollectionView
Fixes xamarin#9282

* Fix formatting
)

* [iOS] Fix when removing current last Item on CarouselView

* [Uitests] Try fix test for 12574

* [iOS] Fix scroll when removing item on CarouselView

* [iOS] Use CollectionView.PerformBatchUpdates to scroll to item after CollectionView reloads it's items

* [iOS] Set Reload next to Scroll to better understand the logic between the 2

* [iOS] Fix for reload items and wait for iOS12 and iOS11

* Provide pre and post update events for CarouselView to do its bookkeeping

* Remove animation after item removal

* [Controls] Fix sample 12574

* [UITests] Enable test

* Remove performBatchUpdates calls to prevent data disparity;

* Remove async stuff from ObservableGroupedSource

* Fix reload race condition with deletion/insertion of groups

* Reset current item and position when ItemsSource resets

* Update ObservableSource count before invoking Carousel's changed handler;
Reset position/current item on ItemsSource update
Don't update position until drag is released

* Clean up unnecessary ReloadRequired stuff

* Handle UICollectionView internal accounting edge cases

Co-authored-by: E.Z. Hart <hartez@gmail.com>
…amarin#11679)

* added constructor actionsheet

* added flow direction to action sheets on Android

* added flow direction to alerts on Android

* added Android alert dialog flow direction

* UWP alert/actionsheet flow direction

* add alert dialog flow direction

* added flow direction to UWP alert and actionsheets

* fixes xamarin#2448

* fixes xamarin#2448

* fixes xamarin#2448

* fixes xamarin#2448

* fixes xamarin#2448

* fixes xamarin#2448

* fixes xamarin#2448

* Fix rebase errors

* - fix rebase

Co-authored-by: E.Z. Hart <hartez@gmail.com>
Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…t selecting visible content (xamarin#13046) fixes xamarin#12642

* Convert to Property Animators

* - uitests

* Update ShellSectionRootRenderer.cs

* - fix nre
…4720) (xamarin#12509)

* To address issue xamarin#4720:
Add option for custom renderers to control the execution mode of the WebView control
This is 'opt-in' as by default this commit will not change behavior of existing applciations.  to opt-in, people would need to set the ExecutionMode property in the constructor of their custom WebViewRenderer, like:

  public class MyWebViewRenderer : WebViewRenderer
  {
    public MyWebViewRenderer()
    {
      ExecutionMode = Windows.UI.Xaml.Controls.WebViewExecutionMode.SeparateProcess;
    }
  }

When set as 'SeparateProcess', the memory allocated by the WebView itself is all handled in a sub-process, which ensures the main process never crashes from running out of memory here from doing things like opening and closing youtube every 5 seconds.  This behavior will likely crash when the WebView is in-process due to the huge amounts of memory that is required by that website.

* tabs not spaces

* TemplatedItemsList: Ensure items are unhooked correctly when removing them, whether as individual removals or list resets.  Without this, the native cells do not actually get removed.
CellTableViewCell: use event PropertyChangedEventHandler instead of action (seems more standard)
TextCellRenderer: Correct the event delegate hookup
ListViewRenderer: Actually re-use the UITableViewCell when creating header sections, otherwise we endlessly create new ones, leaving the old ones alive through event handlers

* Revert "TemplatedItemsList: Ensure items are unhooked correctly when removing them, whether as individual removals or list resets.  Without this, the native cells do not actually get removed."

This reverts commit 7da9ffb.

* Make the custom renderer only apply to the test for this issue, as it seems the SeparateProcess affects access to cookies, breaking other tests

* Move additional classes inside test class to decrease namespace cluttering.

* - cleanup and rebase

* - add instructions

* - move WebViewExecutionMode to platform specific

* - fix up UI Test

* - clean up tests

* - fix tabs

* - fix formatting

* - fix teardown call

* - fix async ui test quirk on uwp

Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
…ixes xamarin#12685 fixes xamarin#13020

* Added repro sample

* Fixed the issue

* Update Issue11050.xaml.cs

* Updated issue 10626. Replaced Color by Brush.

* Fixed build error

* Fixed build error

* Added Issue12685 test

* Changes in text format

* Fix rebase error

Co-authored-by: Samantha Houts <samhouts@users.noreply.github.com>
Co-authored-by: E.Z. Hart <hartez@gmail.com>
Co-authored-by: Rui Marinho <me@ruimarinho.net>
…amarin#12750

* Fixed wrong SwipeView Layout in Android

* Fixed build error

* - small fixes

Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
When the activity is destroyed an event remain attached, if the application is a singleton this cause a memory leak of the activity.
… ShellParameters

# Conflicts:
#	Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue10623.cs
#	Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue12642.cs
#	Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue12750.xaml.cs
#	Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue4720.cs
#	Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems
#	Xamarin.Forms.Core.UITests.Shared/Tests/CarouselViewUITests.cs
#	Xamarin.Forms.Core/Shell/Shell.cs
#	Xamarin.Forms.Core/Shell/ShellItem.cs
#	Xamarin.Forms.Platform.Android/Renderers/SwipeViewRenderer.cs
#	Xamarin.Forms.Platform.iOS.UnitTests/ObservableItemsSourceTests.cs
#	Xamarin.Forms.Platform.iOS/CollectionView/IndexPathHelpers.cs
#	Xamarin.Forms.Platform.iOS/CollectionView/ItemsViewController.cs
#	Xamarin.Forms.Platform.iOS/CollectionView/ObservableItemsSource.cs
#	Xamarin.Forms.Platform.iOS/Renderers/SwipeViewRenderer.cs
@@ -495,6 +495,26 @@ public Task GoToAsync(ShellNavigationState state, bool animate)
return _navigationManager.GoToAsync(state, animate, false);
}

internal Task GoToAsync(ShellNavigationState state, ShellRouteParameters parameters)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PureWeen not sure if we still need those methods here...

@PureWeen
Copy link
Contributor

PureWeen commented Jan 7, 2021

Re-closing this one again unfortunately :-/

I've been chatting with @pictos a bit of how to bring this behavior to XCT

@PureWeen PureWeen closed this Jan 7, 2021
v5.0.1 automation moved this from In progress to Done Jan 7, 2021
@angelru
Copy link

angelru commented Feb 1, 2021

will it be available in XCT?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/shell 🐚 blocker Issue blocks next stable release. Prioritize fixing and reviewing this issue. Core m/high impact ⬛ proposal-open t/enhancement ➕
Projects
Development

Successfully merging this pull request may close these issues.

[Enhancement] Shell Navigation with Models