diff --git a/src/Microsoft.AspNetCore.Blazor.Browser/Routing/NavLink.cs b/src/Microsoft.AspNetCore.Blazor/Routing/NavLink.cs
similarity index 91%
rename from src/Microsoft.AspNetCore.Blazor.Browser/Routing/NavLink.cs
rename to src/Microsoft.AspNetCore.Blazor/Routing/NavLink.cs
index 9c478bfa46..a8661bf2af 100644
--- a/src/Microsoft.AspNetCore.Blazor.Browser/Routing/NavLink.cs
+++ b/src/Microsoft.AspNetCore.Blazor/Routing/NavLink.cs
@@ -8,13 +8,8 @@ using System;
using System.Collections.Generic;
using System.Linq;
-namespace Microsoft.AspNetCore.Blazor.Browser.Routing
+namespace Microsoft.AspNetCore.Blazor.Routing
{
- // TODO: Move this into Microsoft.AspNetCore.Blazor, and use DI to break the
- // coupling on Microsoft.AspNetCore.Blazor.Browser.Routing.UriHelper.
- // That's because you'd use NavLink in non-browser scenarios too (e.g., prerendering).
- // Can't do this until DI is implemented.
-
// NOTE: This could be implemented in a more performant way by iterating through
// the ParameterCollection only once (instead of multiple TryGetValue calls), and
// avoiding allocating a dictionary in the case where there are no additional params.
@@ -23,6 +18,10 @@ namespace Microsoft.AspNetCore.Blazor.Browser.Routing
// have more examples of components implemented in pure C# (not Razor) we could change
// this one to the more low-level perf-sensitive implementation.
+ ///
+ /// A component that renders an anchor tag, automatically toggling its 'active'
+ /// class based on whether its 'href' matches the current URI.
+ ///
public class NavLink : IComponent, IDisposable
{
private RenderHandle _renderHandle;
@@ -35,6 +34,7 @@ namespace Microsoft.AspNetCore.Blazor.Browser.Routing
[Inject] private IUriHelper UriHelper { get; set; }
+ ///
public void Init(RenderHandle renderHandle)
{
_renderHandle = renderHandle;
@@ -43,6 +43,7 @@ namespace Microsoft.AspNetCore.Blazor.Browser.Routing
UriHelper.OnLocationChanged += OnLocationChanged;
}
+ ///
public void SetParameters(ParameterCollection parameters)
{
// Capture the parameters we want to do special things with, plus all as a dictionary