Move BrowserRouter -> Router in Microsoft.AspNetCore.Blazor now it has no browser-specific aspects

This commit is contained in:
Steve Sanderson 2018-02-23 10:49:03 +00:00
parent eab10dcf83
commit 0bb32ad628
3 changed files with 8 additions and 8 deletions

View File

@ -1,8 +1,8 @@
@using Microsoft.AspNetCore.Blazor.Browser.Routing @using Microsoft.AspNetCore.Blazor.Routing
<!-- <!--
Configuring this stuff here is temporary. Later we'll move the app config Configuring this stuff here is temporary. Later we'll move the app config
into Program.cs, and it won't be necessary to specify AppAssembly. into Program.cs, and it won't be necessary to specify AppAssembly.
--> -->
<c:BrowserRouter <c:Router
AppAssembly=@(typeof(StandaloneApp.Program).Assembly) AppAssembly=@(typeof(StandaloneApp.Program).Assembly)
PagesNamespace=@("StandaloneApp.Pages") /> PagesNamespace=@("StandaloneApp.Pages") />

View File

@ -9,13 +9,13 @@ using Microsoft.AspNetCore.Blazor.Layouts;
using Microsoft.AspNetCore.Blazor.RenderTree; using Microsoft.AspNetCore.Blazor.RenderTree;
using Microsoft.AspNetCore.Blazor.Services; using Microsoft.AspNetCore.Blazor.Services;
namespace Microsoft.AspNetCore.Blazor.Browser.Routing namespace Microsoft.AspNetCore.Blazor.Routing
{ {
/// <summary> /// <summary>
/// A component that displays whichever other component corresponds to the /// A component that displays whichever other component corresponds to the
/// browser's changing navigation state. /// current navigation location.
/// </summary> /// </summary>
public class BrowserRouter : IComponent, IDisposable public class Router : IComponent, IDisposable
{ {
static readonly char[] _queryOrHashStartChar = new[] { '?', '#' }; static readonly char[] _queryOrHashStartChar = new[] { '?', '#' };
@ -85,7 +85,7 @@ namespace Microsoft.AspNetCore.Blazor.Browser.Routing
} }
return FindComponentTypeInAssemblyOrReferences(AppAssembly, componentTypeName) return FindComponentTypeInAssemblyOrReferences(AppAssembly, componentTypeName)
?? throw new InvalidOperationException($"{nameof(BrowserRouter)} cannot find any component type with name {componentTypeName}."); ?? throw new InvalidOperationException($"{nameof(Router)} cannot find any component type with name {componentTypeName}.");
} }
private string StringUntilAny(string str, char[] chars) private string StringUntilAny(string str, char[] chars)

View File

@ -1,4 +1,4 @@
@using Microsoft.AspNetCore.Blazor.Browser.Routing @using Microsoft.AspNetCore.Blazor.Routing
<c:BrowserRouter AppAssembly=@(typeof(BasicTestApp.Program).Assembly) <c:Router AppAssembly=@(typeof(BasicTestApp.Program).Assembly)
PagesNamespace=@nameof(BasicTestApp) PagesNamespace=@nameof(BasicTestApp)
DefaultComponentName=@("Default") /> DefaultComponentName=@("Default") />