From be30a6a793c8395066883ba2c17d403aed2d5799 Mon Sep 17 00:00:00 2001 From: Shane Neuville Date: Thu, 25 May 2023 14:55:39 -0500 Subject: [PATCH] Obsolete Dictionary and shift to single state object --- src/Controls/src/Core/Shell/Shell.cs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/Controls/src/Core/Shell/Shell.cs b/src/Controls/src/Core/Shell/Shell.cs index 436b77b239d2..8a7b11beb82c 100644 --- a/src/Controls/src/Core/Shell/Shell.cs +++ b/src/Controls/src/Core/Shell/Shell.cs @@ -677,6 +677,7 @@ public Task GoToAsync(ShellNavigationState state, bool animate) /// #pragma warning disable CS1573 // Parameter has no matching param tag in the XML comment (but other parameters do) + [Obsolete] public Task GoToAsync(ShellNavigationState state, IDictionary parameters) #pragma warning restore CS1573 // Parameter has no matching param tag in the XML comment (but other parameters do) { @@ -685,12 +686,35 @@ public Task GoToAsync(ShellNavigationState state, IDictionary pa /// #pragma warning disable CS1573 // Parameter has no matching param tag in the XML comment (but other parameters do) + [Obsolete] public Task GoToAsync(ShellNavigationState state, bool animate, IDictionary parameters) #pragma warning restore CS1573 // Parameter has no matching param tag in the XML comment (but other parameters do) { return _navigationManager.GoToAsync(state, animate, false, parameters: new ShellRouteParameters(parameters)); } + /// +#pragma warning disable CS1573 // Parameter has no matching param tag in the XML comment (but other parameters do) +#pragma warning disable RS0016 // Add public types and members to the declared API + // This will propagate your navigationState to a key/property with the name "navigationState" + // NavigationState isn't maintained between navigations and will only propagate to your page during initial navigation + public Task GoToAsync(ShellNavigationState state, object navigationState) +#pragma warning restore CS1573 // Parameter has no matching param tag in the XML comment (but other parameters do) + { + return GoToAsync(state, new KeyValuePair("NavigationState", navigationState)); + } + +#pragma warning disable RS0016 // Add public types and members to the declared API + // This can be used to propagate your navigationState to a specific key of your choosing. + // NavigationState isn't maintained between navigations and will only propagate to your page during initial navigation + public Task GoToAsync(ShellNavigationState state, KeyValuePair navigationState) +#pragma warning restore CS1573 // Parameter has no matching param tag in the XML comment (but other parameters do) + { + throw new NotImplementedException(); + } + +#pragma warning restore RS0016 // Add public types and members to the declared API + public void AddLogicalChild(Element element) { if (element == null)