├── Samples └── 01 │ ├── BlazorApp │ ├── wwwroot │ │ ├── favicon.ico │ │ ├── css │ │ │ ├── open-iconic │ │ │ │ ├── font │ │ │ │ │ ├── fonts │ │ │ │ │ │ ├── open-iconic.eot │ │ │ │ │ │ ├── open-iconic.otf │ │ │ │ │ │ ├── open-iconic.ttf │ │ │ │ │ │ ├── open-iconic.woff │ │ │ │ │ │ └── open-iconic.svg │ │ │ │ │ └── css │ │ │ │ │ │ └── open-iconic-bootstrap.min.css │ │ │ │ ├── ICON-LICENSE │ │ │ │ ├── README.md │ │ │ │ └── FONT-LICENSE │ │ │ └── app.css │ │ ├── sample-data │ │ │ └── weather.json │ │ └── index.html │ ├── Pages │ │ ├── Index.razor │ │ ├── LazyComponent.razor │ │ ├── Counter.razor │ │ └── FetchData.razor │ ├── _Imports.razor │ ├── Shared │ │ ├── MainLayout.razor │ │ ├── SurveyPrompt.razor │ │ └── NavMenu.razor │ ├── App.razor │ ├── BlazorApp.csproj │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ └── AreaAssemblyLazyLoadResolver.cs │ └── LazyLoadedArea │ ├── Shared │ └── DifficultComponent.razor │ ├── Pages │ ├── LazyLoadedPage02.razor │ └── LazyLoadedPage01.razor │ ├── TimeProvider.cs │ ├── LazyLoadedArea.csproj │ ├── MessagesProvider.cs │ ├── Program.cs │ └── Properties │ └── launchSettings.json ├── ReleaseNotes.md ├── src └── BlazorLazyLoad │ ├── BlazorLazyLoad.csproj │ ├── JSInteropMethods.cs │ ├── IAssemblyLazyLoader.cs │ ├── AssemblyProvider.cs │ ├── LazyLoadServicesExtensions.cs │ ├── AssemblyDependencyResolver.cs │ ├── LazyLoadComponentPlaceHolder.cs │ └── RouterLL.cs ├── LICENSE ├── README.md ├── BlazorLazyLoad.sln └── .gitignore /Samples/01/BlazorApp/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarekPokornyOva/BlazorLazyLoad/HEAD/Samples/01/BlazorApp/wwwroot/favicon.ico -------------------------------------------------------------------------------- /Samples/01/LazyLoadedArea/Shared/DifficultComponent.razor: -------------------------------------------------------------------------------- 1 | @Title 2 | 3 | @code { 4 | [Parameter] 5 | public string Title { get; set; } 6 | } 7 | -------------------------------------------------------------------------------- /Samples/01/BlazorApp/Pages/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 |

Hello, world!

4 | 5 | Welcome to your new app. 6 | 7 | 8 | -------------------------------------------------------------------------------- /Samples/01/BlazorApp/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarekPokornyOva/BlazorLazyLoad/HEAD/Samples/01/BlazorApp/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /Samples/01/BlazorApp/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarekPokornyOva/BlazorLazyLoad/HEAD/Samples/01/BlazorApp/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /Samples/01/BlazorApp/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarekPokornyOva/BlazorLazyLoad/HEAD/Samples/01/BlazorApp/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /Samples/01/BlazorApp/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarekPokornyOva/BlazorLazyLoad/HEAD/Samples/01/BlazorApp/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /Samples/01/LazyLoadedArea/Pages/LazyLoadedPage02.razor: -------------------------------------------------------------------------------- 1 | @page "/lazyLoaded/page02" 2 | 3 | @inject ITimeProvider _timeProvider 4 | 5 |

Lazy load feature works!

6 | 7 | Current time is: @_timeProvider.GetTime() -------------------------------------------------------------------------------- /Samples/01/LazyLoadedArea/Pages/LazyLoadedPage01.razor: -------------------------------------------------------------------------------- 1 | @page "/lazyLoaded/page01" 2 | 3 | @inject IMessageProvider _messageProvider 4 | 5 |

Lazy load feature works!

6 | 7 | Message of the day: @_messageProvider.GetMessage() 8 | -------------------------------------------------------------------------------- /Samples/01/BlazorApp/Pages/LazyComponent.razor: -------------------------------------------------------------------------------- 1 | @page "/lazycomponent" 2 | 3 |

Lazy loaded component

4 | 5 | -------------------------------------------------------------------------------- /Samples/01/LazyLoadedArea/TimeProvider.cs: -------------------------------------------------------------------------------- 1 | #region using 2 | using System; 3 | #endregion using 4 | 5 | namespace LazyLoadedArea 6 | { 7 | public class TimeProvider:ITimeProvider 8 | { 9 | public DateTime GetTime() 10 | => DateTime.Now; 11 | } 12 | 13 | public interface ITimeProvider 14 | { 15 | DateTime GetTime(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Samples/01/BlazorApp/Pages/Counter.razor: -------------------------------------------------------------------------------- 1 | @page "/counter" 2 | 3 |

Counter

4 | 5 |

Current count: @currentCount

6 | 7 | 8 | 9 | @code { 10 | private int currentCount = 0; 11 | 12 | private void IncrementCount() 13 | { 14 | currentCount++; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Samples/01/BlazorApp/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using Microsoft.AspNetCore.Components.WebAssembly.Http 7 | @using Microsoft.JSInterop 8 | @using BlazorApp 9 | @using BlazorApp.Shared 10 | -------------------------------------------------------------------------------- /Samples/01/BlazorApp/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 | 6 | 7 |
8 |
9 | About 10 |
11 | 12 |
13 | @Body 14 |
15 |
16 | -------------------------------------------------------------------------------- /Samples/01/BlazorApp/App.razor: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Sorry, there's nothing at this address.

8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /Samples/01/LazyLoadedArea/LazyLoadedArea.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.1 5 | 3.0 6 | LazyLoaded 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Samples/01/LazyLoadedArea/MessagesProvider.cs: -------------------------------------------------------------------------------- 1 | namespace LazyLoadedArea 2 | { 3 | public class CircuitMessagesProvider:IMessageProvider 4 | { 5 | int _index = 0; 6 | static string[] _messages = new string[] { "That's great assembly lazy load works.", "It's cool the services registration and injection works too!" }; 7 | 8 | public string GetMessage() 9 | { 10 | _index++; 11 | if (_index>=_messages.Length) 12 | _index=0; 13 | return _messages[_index]; 14 | } 15 | } 16 | 17 | public interface IMessageProvider 18 | { 19 | string GetMessage(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Samples/01/BlazorApp/wwwroot/sample-data/weather.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "date": "2018-05-06", 4 | "temperatureC": 1, 5 | "summary": "Freezing" 6 | }, 7 | { 8 | "date": "2018-05-07", 9 | "temperatureC": 14, 10 | "summary": "Bracing" 11 | }, 12 | { 13 | "date": "2018-05-08", 14 | "temperatureC": -13, 15 | "summary": "Freezing" 16 | }, 17 | { 18 | "date": "2018-05-09", 19 | "temperatureC": -16, 20 | "summary": "Balmy" 21 | }, 22 | { 23 | "date": "2018-05-10", 24 | "temperatureC": -2, 25 | "summary": "Chilly" 26 | } 27 | ] 28 | -------------------------------------------------------------------------------- /Samples/01/LazyLoadedArea/Program.cs: -------------------------------------------------------------------------------- 1 | #region using 2 | using Microsoft.Extensions.DependencyInjection; 3 | #endregion using 4 | 5 | namespace LazyLoadedArea 6 | { 7 | public class Program 8 | { 9 | public static void Main(string[] args) 10 | { 11 | //this entrypoint is requested only during project build. Otherwise, it's useless. 12 | } 13 | 14 | public static void ConfigureServices(IServiceCollection services) 15 | { 16 | services.AddSingleton(); 17 | services.AddSingleton(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Samples/01/BlazorApp/Shared/SurveyPrompt.razor: -------------------------------------------------------------------------------- 1 | 11 | 12 | @code { 13 | // Demonstrates how a parent component can supply parameters 14 | [Parameter] 15 | public string Title { get; set; } 16 | } 17 | -------------------------------------------------------------------------------- /ReleaseNotes.md: -------------------------------------------------------------------------------- 1 | ### 1.0.0 (2020-05-24) 2 | * AspNetCore.Components version 3.2.0 used. 3 | 4 | ### 0.2.4-3.2.0-20223.4 (2020-05-04) 5 | * AspNetCore.Components version 3.2.0-rc1.20223.4 used. 6 | * Avoid multiple download on LazyLoadComponentPlaceHolder. 7 | 8 | ### 0.2.3-3.2.0-20210.8 (2020-04-21) 9 | * Add lazy loading on component level. 10 | 11 | ### 0.2.2-3.2.0-20210.8 (2020-04-17) 12 | * Downloads gzipped assemblies by default. 13 | * AspNetCore.Components version 3.2.0-preview4.20210.8 used. 14 | 15 | ### 0.2.1-3.2.0-20073.1 (2020-02-17) 16 | * Add referenced assemblies load support. 17 | 18 | ### 0.2-3.2.0-20073.1 (2020-02-15) 19 | * Avoid displaying NotFound fragment during assembly load/init. 20 | 21 | ### 0.1-3.2.0-20073.1 (2020-02-12) 22 | * Initial version 23 | -------------------------------------------------------------------------------- /Samples/01/LazyLoadedArea/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:54980/", 7 | "sslPort": 44352 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "LazyLoaded": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "https://localhost:5001;http://localhost:5000" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /Samples/01/BlazorApp/BlazorApp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.1 5 | 3.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Samples/01/BlazorApp/Program.cs: -------------------------------------------------------------------------------- 1 | #region using 2 | using System; 3 | using System.Net.Http; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Components.WebAssembly.Hosting; 6 | using BlazorLazyLoad; 7 | using Microsoft.Extensions.DependencyInjection; 8 | #endregion using 9 | 10 | namespace BlazorApp 11 | { 12 | public class Program 13 | { 14 | public static async Task Main(string[] args) 15 | { 16 | var builder = WebAssemblyHostBuilder.CreateDefault(args); 17 | builder.RootComponents.Add("app"); 18 | 19 | builder.Services.AddTransient(sp => new HttpClient { BaseAddress=new Uri(builder.HostEnvironment.BaseAddress) }); 20 | LazyLoadServicesBuilder lazyLoadServicesBuilder = builder.Services.AddLazyLoad(); 21 | 22 | WebAssemblyHost host = builder.Build(); 23 | lazyLoadServicesBuilder.SetHost(host); 24 | await host.RunAsync(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Samples/01/BlazorApp/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:54794/", 7 | "sslPort": 44344 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 15 | "environmentVariables": { 16 | "ASPNETCORE_ENVIRONMENT": "Development" 17 | } 18 | }, 19 | "BlazorApp": { 20 | "commandName": "Project", 21 | "launchBrowser": true, 22 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | }, 26 | "applicationUrl": "https://localhost:5001;http://localhost:5000" 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /src/BlazorLazyLoad/BlazorLazyLoad.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.1 5 | Blazor LazyLoad 6 | https://github.com/MarekPokornyOva/BlazorLazyLoad 7 | https://github.com/MarekPokornyOva/BlazorLazyLoad 8 | MpSoft 9 | Marek Pokorný 10 | BlazorLazyLoad 11 | BlazorLazyLoad is concept of assembly lazy load in Blazor WASM application. 12 | 1.0.0 13 | LICENSE 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | True 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 MarekPokornyOva 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Samples/01/BlazorApp/wwwroot/css/open-iconic/ICON-LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /src/BlazorLazyLoad/JSInteropMethods.cs: -------------------------------------------------------------------------------- 1 | #region using 2 | using Microsoft.AspNetCore.Components.WebAssembly.Hosting; 3 | using Microsoft.Extensions.DependencyInjection; 4 | using Microsoft.JSInterop; 5 | using System; 6 | using System.ComponentModel; 7 | using System.Threading.Tasks; 8 | #endregion using 9 | 10 | namespace BlazorLazyLoad 11 | { 12 | [EditorBrowsable(EditorBrowsableState.Never)] 13 | public static class JSInteropMethods 14 | { 15 | internal static IServiceProvider ServiceProvider; 16 | internal static IServiceCollection Services; 17 | internal static WebAssemblyHost Host; 18 | internal static IRouterEnvelope Router; 19 | 20 | [JSInvokable("NotifyLocationChanged")] 21 | public static async Task NotifyLocationChanged(string uri,bool isInterceptedLink) 22 | { 23 | await ServiceProvider.GetRequiredService().ResolveAsync(uri,isInterceptedLink); 24 | 25 | //Would it be possible to send original parameters and call it via DotNetDispatcher? It'd need to get ServiceProvider.GetRequiredService() instance. 26 | Microsoft.AspNetCore.Components.WebAssembly.Infrastructure.JSInteropMethods.NotifyLocationChanged(uri,isInterceptedLink); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Samples/01/BlazorApp/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | BlazorApp 8 | 9 | 10 | 11 | 12 | 13 | 14 | Loading... 15 | 16 |
17 | An unhandled error has occurred. 18 | Reload 19 | 🗙 20 |
21 | 22 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /Samples/01/BlazorApp/Pages/FetchData.razor: -------------------------------------------------------------------------------- 1 | @page "/fetchdata" 2 | @inject HttpClient Http 3 | 4 |

Weather forecast

5 | 6 |

This component demonstrates fetching data from the server.

7 | 8 | @if (forecasts == null) 9 | { 10 |

Loading...

11 | } 12 | else 13 | { 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | @foreach (var forecast in forecasts) 25 | { 26 | 27 | 28 | 29 | 30 | 31 | 32 | } 33 | 34 |
DateTemp. (C)Temp. (F)Summary
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
35 | } 36 | 37 | @code { 38 | private WeatherForecast[] forecasts; 39 | 40 | protected override async Task OnInitializedAsync() 41 | { 42 | forecasts = await Http.GetFromJsonAsync("sample-data/weather.json"); 43 | } 44 | 45 | public class WeatherForecast 46 | { 47 | public DateTime Date { get; set; } 48 | 49 | public int TemperatureC { get; set; } 50 | 51 | public string Summary { get; set; } 52 | 53 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Samples/01/BlazorApp/Shared/NavMenu.razor: -------------------------------------------------------------------------------- 1 | 7 | 8 |
9 | 41 |
42 | 43 | @code { 44 | private bool collapseNavMenu = true; 45 | 46 | private string NavMenuCssClass => collapseNavMenu ? "collapse" : null; 47 | 48 | private void ToggleNavMenu() 49 | { 50 | collapseNavMenu = !collapseNavMenu; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Samples/01/BlazorApp/AreaAssemblyLazyLoadResolver.cs: -------------------------------------------------------------------------------- 1 | #region using 2 | using BlazorLazyLoad; 3 | using Microsoft.AspNetCore.Components; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Threading.Tasks; 9 | #endregion using 10 | 11 | namespace BlazorApp 12 | { 13 | public class AreaAssemblyLazyLoadResolver:AssemblyLazyLoadResolverBase 14 | { 15 | readonly IAssemblyDependencyResolver _assemblyDependencyResolver; 16 | public AreaAssemblyLazyLoadResolver(IAssemblyDependencyResolver assemblyDependencyResolver) 17 | { 18 | _assemblyDependencyResolver=assemblyDependencyResolver; 19 | } 20 | 21 | public override async Task ResolveAsync(string uri,bool isInterceptedLink) 22 | { 23 | //Get requested assembly based on the first path segment. This is highly specific, other applications might use different strategy. 24 | string[] segments = new Uri(uri,UriKind.Absolute).Segments.Select(x => x.Trim('/')).Where(x => x.Length>0).ToArray(); 25 | if (segments.Length<2) 26 | return; 27 | string assemblyName = segments[0]; 28 | 29 | //We need to inject new assembly to the router because it resolves which page to display. 30 | IRouterEnvelope router = base.Router; 31 | 32 | IEnumerable additionalAssemblies = router.AdditionalAssemblies??Enumerable.Empty(); 33 | //Don't inject the assembly multiple times. 34 | if (additionalAssemblies.Any(x => string.Equals(x.GetName().Name,assemblyName,StringComparison.OrdinalIgnoreCase))) 35 | return; 36 | 37 | //Load assembly including its dependencies 38 | IEnumerable newAssemblies = await _assemblyDependencyResolver.ResolveAsync(assemblyName); 39 | if (!newAssemblies.Any()) 40 | return; 41 | 42 | //Register also services 43 | foreach (Assembly asm in newAssemblies) 44 | LoadServices(asm); 45 | 46 | //Inject the assembly to the router. 47 | ParameterView pv = ParameterView.FromDictionary(router.GetType().GetProperties() 48 | .Where(x => x.CustomAttributes.Any(x => x.AttributeType==typeof(ParameterAttribute))) 49 | .ToDictionary(pi => pi.Name,pi => string.Equals(pi.Name,nameof(IRouterEnvelope.AdditionalAssemblies),StringComparison.Ordinal) 50 | ? additionalAssemblies.Concat(newAssemblies).ToArray() 51 | : pi.GetValue(router))); 52 | await router.SetParametersAsync(pv); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BlazorLazyLoad 2 | 3 | [![Package Version](https://img.shields.io/nuget/v/BlazorLazyLoad.svg)](https://www.nuget.org/packages/BlazorLazyLoad) 4 | [![NuGet Downloads](https://img.shields.io/nuget/dt/BlazorLazyLoad.svg)](https://www.nuget.org/packages/BlazorLazyLoad) 5 | [![License](https://img.shields.io/github/license/MarekPokornyOva/BlazorLazyLoad.svg)](https://github.com/MarekPokornyOva/BlazorLazyLoad/blob/master/LICENSE) 6 | 7 | ### Description 8 | BlazorLazyLoad is mostly loudly shared idea/concept of assembly lazy load in Blazor WASM application. 9 | Splitting an application speeds up its start and also saves network traffic. 10 | 11 | ### Features 12 | - Lazy loads assemblies. 13 | - Lazy resolving on both page and component level. 14 | - Registers included pages for routing. 15 | - Registers included services to ServiceProvider. 16 | 17 | ### Usage 18 | 1) Include Nuget package - https://www.nuget.org/packages/BlazorLazyLoad/ in Blazor WASM application's project. 19 | 2) Create custom assembly lazy load handler. The \Samples\01\BlazorApp\AreaAssemblyLazyLoadResolver.cs might be good example - it expects areas split strategy. The resolver can also register the services defined in the lazy loaded assembly. 20 | 3) Change Router in App.razor to the enhanced one. That invokes AssemblyLazyLoadResolver when a lazy loaded page is navigated at first (entered to navigation bar or on the page refresh). 21 | 4) Register services - call builder.Services.AddLazyLoad(); within Program.Main() method. 22 | 5) Redirect navigation event to custom handler - see \Samples\01\BlazorApp\wwwroot\index.html. 23 | 6) Create project containing lazy loaded pages - see \Samples\01\LazyLoadedArea. 24 | 7) The built assembly has to be copied from wwwroot\\_framework\\_bin to the main project's wwwroot\\_framework\\bin folder. It's recommended to use gzipped versions. 25 | 8) See \Samples\01\BlazorApp\Pages\LazyComponent for component level lazy loading. 26 | 27 | ### Notes 28 | - All is provided as is without any warranty. 29 | - The target of this concept has been "make it functional for any price". Therefore some pieces are bit "hacky". 30 | - Developed with version 3.2.0 wasm. 31 | 32 | ### Release notes 33 | [See](./ReleaseNotes.md) 34 | 35 | ### Thanks to Blazor team members for their work 36 | ### Thanks to Chris Sainty for his article https://chrissainty.com/an-in-depth-look-at-routing-in-blazor/ 37 | -------------------------------------------------------------------------------- /src/BlazorLazyLoad/IAssemblyLazyLoader.cs: -------------------------------------------------------------------------------- 1 | #region using 2 | using Microsoft.AspNetCore.Components.WebAssembly.Hosting; 3 | using Microsoft.AspNetCore.Components.RenderTree; 4 | using Microsoft.Extensions.DependencyInjection; 5 | using System; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Runtime.CompilerServices; 9 | using System.Threading.Tasks; 10 | #endregion using 11 | 12 | namespace BlazorLazyLoad 13 | { 14 | public interface IAssemblyLazyLoadResolver 15 | { 16 | Task ResolveAsync(string uri,bool isInterceptedLink); 17 | } 18 | 19 | public abstract class AssemblyLazyLoadResolverBase:IAssemblyLazyLoadResolver 20 | { 21 | public abstract Task ResolveAsync(string uri,bool isInterceptedLink); 22 | 23 | protected IRouterEnvelope Router => JSInteropMethods.Router; 24 | 25 | public static void LoadServices(Assembly assembly) 26 | { 27 | //Find Program.ConfigureServices(IServiceCollection) method. 28 | MethodInfo configureServices = FindDefaultConfigureServicesMethod(assembly); 29 | if (configureServices==default) 30 | return; 31 | 32 | LoadServices(configureServices); 33 | } 34 | 35 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 36 | static MethodInfo FindDefaultConfigureServicesMethod(Assembly assembly) 37 | => assembly.GetTypes().FirstOrDefault(x => string.Equals(x.Name,"Program",StringComparison.Ordinal))? 38 | .GetMethod("ConfigureServices",BindingFlags.Public|BindingFlags.Static,null,new Type[] { typeof(IServiceCollection) },null); 39 | 40 | public static void LoadServices(MethodInfo configureServices) 41 | { 42 | //Call the ConfigureServices(IServiceCollection) method. 43 | IServiceCollection services = JSInteropMethods.Services; 44 | configureServices.Invoke(null,new object[] { services }); 45 | 46 | //Is it possible to get if a service registration was changed? Maybe with tracking wrapper. But how about specific Factory on transient ServiceDescriptor? 47 | //We can return from this method if nothing got changed. 48 | 49 | //Get new IServiceProvider and inject it to Renderer and WebAssemblyHost. 50 | IServiceProvider sp = services.BuildServiceProvider(); 51 | IServiceScope newScope = sp.GetRequiredService().CreateScope(); 52 | WebAssemblyHost host = JSInteropMethods.Host; 53 | Type hostType = host.GetType(); 54 | hostType.GetField("_scope",BindingFlags.NonPublic|BindingFlags.Instance).SetValue(host,newScope); 55 | object renderer = hostType.GetField("_renderer",BindingFlags.NonPublic|BindingFlags.Instance).GetValue(host); 56 | typeof(Renderer).GetField("_serviceProvider",BindingFlags.NonPublic|BindingFlags.Instance).SetValue(renderer,newScope.ServiceProvider); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/BlazorLazyLoad/AssemblyProvider.cs: -------------------------------------------------------------------------------- 1 | #region using 2 | using System.IO; 3 | using System.IO.Compression; 4 | using System.Net.Http; 5 | using System.Threading.Tasks; 6 | #endregion using 7 | 8 | namespace BlazorLazyLoad 9 | { 10 | public interface IAssemblyProvider 11 | { 12 | Task<(byte[] DllBytes, byte[] PdbBytes)> GetAssemblyAsync(string assemblyName); 13 | } 14 | 15 | #region AssemblyProviderBase 16 | public abstract class AssemblyProviderBase:IAssemblyProvider 17 | { 18 | readonly HttpClient _httpClient; 19 | public AssemblyProviderBase(HttpClient httpClient) 20 | => _httpClient=httpClient; 21 | 22 | public abstract Task<(byte[] DllBytes, byte[] PdbBytes)> GetAssemblyAsync(string assemblyName); 23 | 24 | public Task DownloadFileBytes(string filename) 25 | => _httpClient.GetByteArrayAsync("_framework/_bin/"+filename); 26 | 27 | public async Task TryDownloadFileBytes(string filename) 28 | { 29 | try 30 | { 31 | return await DownloadFileBytes(filename); 32 | } 33 | catch 34 | { } 35 | return null; 36 | } 37 | } 38 | #endregion AssemblyProviderBase 39 | 40 | public class DefaultAssemblyDownloader:AssemblyProviderBase 41 | { 42 | public DefaultAssemblyDownloader(HttpClient httpClient) : base(httpClient) 43 | { } 44 | 45 | public override async Task<(byte[] DllBytes, byte[] PdbBytes)> GetAssemblyAsync(string assemblyName) 46 | { 47 | //Ungzip works with streams but it's still worth to download data as byte[] because HttpClient do various memory optimizations and content length checks when downloading as byte[]. 48 | Task dllBytes = Ungzip(DownloadFileBytes(assemblyName+".dll.gz")); 49 | return (await dllBytes, await Ungzip(TryDownloadFileBytes(assemblyName+".pdb.gz"))); 50 | } 51 | 52 | async Task Ungzip(Task source) 53 | { 54 | byte[] gzipBytes = await source; 55 | if (gzipBytes==null) 56 | return null; 57 | using (Stream gzipStream = new MemoryStream(gzipBytes)) 58 | using (GZipStream decompressStream = new GZipStream(gzipStream,CompressionMode.Decompress)) 59 | using (MemoryStream rawStream = new MemoryStream()) 60 | { 61 | decompressStream.CopyTo(rawStream); 62 | return rawStream.GetBuffer(); 63 | } 64 | } 65 | } 66 | 67 | public class NonGZippedAssemblyDownloader:AssemblyProviderBase 68 | { 69 | public NonGZippedAssemblyDownloader(HttpClient httpClient) : base(httpClient) 70 | { } 71 | 72 | public override async Task<(byte[] DllBytes, byte[] PdbBytes)> GetAssemblyAsync(string assemblyName) 73 | { 74 | Task dllBytes = DownloadFileBytes(assemblyName+".dll"); 75 | return (await dllBytes, await TryDownloadFileBytes(assemblyName+".pdb")); 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/BlazorLazyLoad/LazyLoadServicesExtensions.cs: -------------------------------------------------------------------------------- 1 | #region using 2 | using Microsoft.AspNetCore.Components.WebAssembly.Hosting; 3 | using Microsoft.Extensions.DependencyInjection; 4 | using System; 5 | #endregion using 6 | 7 | namespace BlazorLazyLoad 8 | { 9 | public static class LazyLoadServicesExtensions 10 | { 11 | public static LazyLoadServicesBuilder AddLazyLoadCore(this IServiceCollection services) 12 | { 13 | JSInteropMethods.Services=services; 14 | JSInteropMethods.ServiceProvider=services.BuildServiceProvider(); 15 | return new LazyLoadServicesBuilder(services); 16 | } 17 | 18 | public static LazyLoadServicesBuilder AddLazyLoad(this IServiceCollection services) where TAssemblyLazyLoadResolver : class, IAssemblyLazyLoadResolver 19 | => AddLazyLoad(services); 20 | 21 | public static LazyLoadServicesBuilder AddLazyLoad(this IServiceCollection services) 22 | where TAssemblyLazyLoadResolver : class, IAssemblyLazyLoadResolver 23 | where TAssemblyDependencyResolver : class, IAssemblyDependencyResolver 24 | where TAssemblyProvider : class, IAssemblyProvider 25 | { 26 | services.AddSingleton(); 27 | services.AddSingleton(); 28 | services.AddSingleton(); 29 | return services.AddLazyLoadCore(); 30 | } 31 | 32 | public static LazyLoadServicesBuilder AddLazyLoad(this IServiceCollection services, 33 | Func assemblyLazyLoadResolverImplementationFactory, 34 | Func assemblyDependencyResolverImplementationFactory, 35 | Func assemblyProviderImplementationFactory 36 | ) 37 | where TAssemblyLazyLoadResolver : class, IAssemblyLazyLoadResolver 38 | where TAssemblyDependencyResolver : class, IAssemblyDependencyResolver 39 | where TAssemblyProvider : class, IAssemblyProvider 40 | { 41 | services.AddSingleton(assemblyLazyLoadResolverImplementationFactory); 42 | services.AddSingleton(assemblyDependencyResolverImplementationFactory); 43 | services.AddSingleton(assemblyProviderImplementationFactory); 44 | return services.AddLazyLoadCore(); 45 | } 46 | } 47 | 48 | public class LazyLoadServicesBuilder 49 | { 50 | internal LazyLoadServicesBuilder(IServiceCollection services) 51 | => Services=services; 52 | 53 | public void SetHost(WebAssemblyHost host) 54 | { 55 | JSInteropMethods.Host=host; 56 | } 57 | 58 | public IServiceCollection Services { get; } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/BlazorLazyLoad/AssemblyDependencyResolver.cs: -------------------------------------------------------------------------------- 1 | #region using 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Collections.Immutable; 5 | using System.Linq; 6 | using System.Reflection; 7 | using System.Reflection.Metadata; 8 | using System.Reflection.PortableExecutable; 9 | using System.Threading.Tasks; 10 | #endregion using 11 | 12 | namespace BlazorLazyLoad 13 | { 14 | public interface IAssemblyDependencyResolver 15 | { 16 | Task> ResolveAsync(string assemblyName); 17 | } 18 | 19 | public class MetadataAssemblyDependencyResolver:IAssemblyDependencyResolver 20 | { 21 | static AssemblyNameComparer _assemblyNameComparer = new AssemblyNameComparer(); 22 | readonly IAssemblyProvider _assemblyProvider; 23 | 24 | public MetadataAssemblyDependencyResolver(IAssemblyProvider assemblyProvider) 25 | => _assemblyProvider=assemblyProvider; 26 | 27 | public async Task> ResolveAsync(string assemblyName) 28 | { 29 | Dictionary assemblies = new Dictionary(_assemblyNameComparer); 30 | await ProcessAssemblyNameAsync(assemblyName,assemblies); 31 | 32 | //AppDomain.CurrentDomain.AssemblyResolve+=(sender,args) => { return null; args. }; 33 | return assemblies.Select(x => { (byte[] dllBytes, byte[] pdbBytes)=x.Value; Assembly asm = pdbBytes==null ? Assembly.Load(dllBytes) : Assembly.Load(dllBytes,pdbBytes); return asm; }).ToArray(); 34 | } 35 | 36 | async Task ProcessAssemblyNameAsync(string assemblyName,Dictionary assemblies) 37 | { 38 | //Get assembly 39 | (byte[] DllBytes, byte[] PdbBytes) bytes = await _assemblyProvider.GetAssemblyAsync(assemblyName); 40 | assemblies[assemblyName]=bytes; 41 | 42 | //Resolve referenced assemblies 43 | string[] assemblyReferences; 44 | using (PEReader pEReader = new PEReader(ImmutableArray.Create(bytes.DllBytes))) 45 | { 46 | MetadataReader mdReader = pEReader.GetMetadataReader(MetadataReaderOptions.None); 47 | assemblyReferences=mdReader.AssemblyReferences.Select(x => mdReader.GetAssemblyReference(x).GetAssemblyName().Name).ToArray(); 48 | } 49 | 50 | //Filter out referenced assemblies already managed or loaded 51 | lock (assemblies) 52 | { 53 | assemblyReferences=assemblyReferences.Where(x => !assemblies.ContainsKey(x)) 54 | .Except(AppDomain.CurrentDomain.GetAssemblies().Select(x => x.GetName().Name),_assemblyNameComparer) 55 | .ToArray(); 56 | foreach (string item in assemblyReferences) 57 | assemblies.Add(item,default); 58 | } 59 | 60 | //Find deeper references 61 | await Task.WhenAll(assemblyReferences.Select(x => ProcessAssemblyNameAsync(x,assemblies))); 62 | } 63 | 64 | class AssemblyNameComparer:IEqualityComparer 65 | { 66 | public bool Equals(string x,string y) 67 | => string.Equals(x,y,StringComparison.OrdinalIgnoreCase); 68 | 69 | public int GetHashCode(string obj) 70 | => 0; 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/BlazorLazyLoad/LazyLoadComponentPlaceHolder.cs: -------------------------------------------------------------------------------- 1 | #region using 2 | using Microsoft.AspNetCore.Components; 3 | using Microsoft.AspNetCore.Components.Rendering; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Threading.Tasks; 9 | #endregion using 10 | 11 | namespace BlazorLazyLoad 12 | { 13 | public class LazyLoadComponentPlaceHolder:ComponentBase 14 | { 15 | Type _innerComponentType; 16 | KeyValuePair[] _parms; 17 | 18 | [Inject] IAssemblyDependencyResolver AssemblyDependencyResolver { get; set; } 19 | 20 | public async override Task SetParametersAsync(ParameterView parameters) 21 | { 22 | IReadOnlyDictionary parms=parameters.ToDictionary(); 23 | 24 | if (!(parms.TryGetValue("_Assembly",out object asmVal)&&(asmVal is string asm)&&parms.TryGetValue("_Type",out object typeVal)&&typeVal is string type)) 25 | throw new ArgumentException("Specify _Assembly and _Type attributes as string values identifying a valid component class."); 26 | _parms=parms.Where(x => string.Equals(x.Key,"_Assembly",StringComparison.OrdinalIgnoreCase)==string.Equals(x.Key,"_Type",StringComparison.OrdinalIgnoreCase)).ToArray(); 27 | 28 | _innerComponentType=await EnsureComponentAsync(asm,type); 29 | if (_innerComponentType==null) 30 | throw new ArgumentException($"Assembly {asm} can't be resolved."); 31 | 32 | StateHasChanged(); 33 | } 34 | 35 | protected override void BuildRenderTree(RenderTreeBuilder builder) 36 | { 37 | builder.OpenComponent(1,_innerComponentType); 38 | int a = 1; 39 | foreach (KeyValuePair parm in _parms) 40 | builder.AddAttribute(++a,parm.Key,parm.Value); 41 | builder.CloseComponent(); 42 | } 43 | 44 | async Task EnsureComponentAsync(string assemblyName,string type) 45 | { 46 | //We need to inject new assembly to the router because it resolves which page to display. 47 | IRouterEnvelope router = JSInteropMethods.Router; 48 | IEnumerable additionalAssemblies = router.AdditionalAssemblies??Enumerable.Empty(); 49 | 50 | //Don't inject the assembly multiple times. 51 | Assembly asm = additionalAssemblies.FirstOrDefault(x => string.Equals(x.GetName().Name,assemblyName,StringComparison.OrdinalIgnoreCase)); 52 | if (asm==default) 53 | { 54 | //Load assembly including its dependencies 55 | IEnumerable newAssemblies = await AssemblyDependencyResolver.ResolveAsync(assemblyName); 56 | if (!newAssemblies.Any()) 57 | return null; 58 | 59 | LoadServices(newAssemblies); 60 | 61 | //Inject the assembly to the router. 62 | ParameterView pv = ParameterView.FromDictionary(new Dictionary() { { nameof(IRouterEnvelope.AdditionalAssemblies),additionalAssemblies.Concat(newAssemblies).ToArray() } }); 63 | await router.SetParametersAsync(pv); 64 | 65 | asm=newAssemblies.First(); 66 | } 67 | 68 | return asm.GetType(type,true); 69 | } 70 | 71 | protected virtual void LoadServices(IEnumerable newAssemblies) 72 | { 73 | foreach (Assembly asm in newAssemblies) 74 | AssemblyLazyLoadResolverBase.LoadServices(asm); 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /BlazorLazyLoad.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29709.97 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorApp", "Samples\01\BlazorApp\BlazorApp.csproj", "{DA6694D6-2F03-43F1-89B3-A4E79E99E4C8}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{FD7A9FE6-95E9-498C-B9B2-3153234A32FF}" 9 | EndProject 10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "01", "01", "{4B1FB6EE-3025-4A3A-A6C9-00CA17E2A2F3}" 11 | EndProject 12 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{28E3785A-B870-4B10-93F2-3C555BBBA481}" 13 | EndProject 14 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LazyLoadedArea", "Samples\01\LazyLoadedArea\LazyLoadedArea.csproj", "{1E88354F-A7FF-4E76-A158-DA248DE09D30}" 15 | EndProject 16 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{44E9EAAF-A5F8-409E-9A17-B25A9E69D579}" 17 | ProjectSection(SolutionItems) = preProject 18 | LICENSE = LICENSE 19 | README.md = README.md 20 | ReleaseNotes.md = ReleaseNotes.md 21 | EndProjectSection 22 | EndProject 23 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorLazyLoad", "src\BlazorLazyLoad\BlazorLazyLoad.csproj", "{7CBE2DB8-07C6-494A-91E4-0B1D2F638F37}" 24 | EndProject 25 | Global 26 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 27 | Debug|Any CPU = Debug|Any CPU 28 | Release|Any CPU = Release|Any CPU 29 | EndGlobalSection 30 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 31 | {DA6694D6-2F03-43F1-89B3-A4E79E99E4C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 32 | {DA6694D6-2F03-43F1-89B3-A4E79E99E4C8}.Debug|Any CPU.Build.0 = Debug|Any CPU 33 | {DA6694D6-2F03-43F1-89B3-A4E79E99E4C8}.Release|Any CPU.ActiveCfg = Release|Any CPU 34 | {DA6694D6-2F03-43F1-89B3-A4E79E99E4C8}.Release|Any CPU.Build.0 = Release|Any CPU 35 | {1E88354F-A7FF-4E76-A158-DA248DE09D30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 36 | {1E88354F-A7FF-4E76-A158-DA248DE09D30}.Debug|Any CPU.Build.0 = Debug|Any CPU 37 | {1E88354F-A7FF-4E76-A158-DA248DE09D30}.Release|Any CPU.ActiveCfg = Release|Any CPU 38 | {1E88354F-A7FF-4E76-A158-DA248DE09D30}.Release|Any CPU.Build.0 = Release|Any CPU 39 | {7CBE2DB8-07C6-494A-91E4-0B1D2F638F37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 40 | {7CBE2DB8-07C6-494A-91E4-0B1D2F638F37}.Debug|Any CPU.Build.0 = Debug|Any CPU 41 | {7CBE2DB8-07C6-494A-91E4-0B1D2F638F37}.Release|Any CPU.ActiveCfg = Release|Any CPU 42 | {7CBE2DB8-07C6-494A-91E4-0B1D2F638F37}.Release|Any CPU.Build.0 = Release|Any CPU 43 | EndGlobalSection 44 | GlobalSection(SolutionProperties) = preSolution 45 | HideSolutionNode = FALSE 46 | EndGlobalSection 47 | GlobalSection(NestedProjects) = preSolution 48 | {DA6694D6-2F03-43F1-89B3-A4E79E99E4C8} = {4B1FB6EE-3025-4A3A-A6C9-00CA17E2A2F3} 49 | {4B1FB6EE-3025-4A3A-A6C9-00CA17E2A2F3} = {FD7A9FE6-95E9-498C-B9B2-3153234A32FF} 50 | {1E88354F-A7FF-4E76-A158-DA248DE09D30} = {4B1FB6EE-3025-4A3A-A6C9-00CA17E2A2F3} 51 | {7CBE2DB8-07C6-494A-91E4-0B1D2F638F37} = {28E3785A-B870-4B10-93F2-3C555BBBA481} 52 | EndGlobalSection 53 | GlobalSection(ExtensibilityGlobals) = postSolution 54 | SolutionGuid = {C305E47F-4B15-40FF-8444-B0C0ACF7F72B} 55 | EndGlobalSection 56 | EndGlobal 57 | -------------------------------------------------------------------------------- /Samples/01/BlazorApp/wwwroot/css/open-iconic/README.md: -------------------------------------------------------------------------------- 1 | [Open Iconic v1.1.1](http://useiconic.com/open) 2 | =========== 3 | 4 | ### Open Iconic is the open source sibling of [Iconic](http://useiconic.com). It is a hyper-legible collection of 223 icons with a tiny footprint—ready to use with Bootstrap and Foundation. [View the collection](http://useiconic.com/open#icons) 5 | 6 | 7 | 8 | ## What's in Open Iconic? 9 | 10 | * 223 icons designed to be legible down to 8 pixels 11 | * Super-light SVG files - 61.8 for the entire set 12 | * SVG sprite—the modern replacement for icon fonts 13 | * Webfont (EOT, OTF, SVG, TTF, WOFF), PNG and WebP formats 14 | * Webfont stylesheets (including versions for Bootstrap and Foundation) in CSS, LESS, SCSS and Stylus formats 15 | * PNG and WebP raster images in 8px, 16px, 24px, 32px, 48px and 64px. 16 | 17 | 18 | ## Getting Started 19 | 20 | #### For code samples and everything else you need to get started with Open Iconic, check out our [Icons](http://useiconic.com/open#icons) and [Reference](http://useiconic.com/open#reference) sections. 21 | 22 | ### General Usage 23 | 24 | #### Using Open Iconic's SVGs 25 | 26 | We like SVGs and we think they're the way to display icons on the web. Since Open Iconic are just basic SVGs, we suggest you display them like you would any other image (don't forget the `alt` attribute). 27 | 28 | ``` 29 | icon name 30 | ``` 31 | 32 | #### Using Open Iconic's SVG Sprite 33 | 34 | Open Iconic also comes in a SVG sprite which allows you to display all the icons in the set with a single request. It's like an icon font, without being a hack. 35 | 36 | Adding an icon from an SVG sprite is a little different than what you're used to, but it's still a piece of cake. *Tip: To make your icons easily style able, we suggest adding a general class to the* `` *tag and a unique class name for each different icon in the* `` *tag.* 37 | 38 | ``` 39 | 40 | 41 | 42 | ``` 43 | 44 | Sizing icons only needs basic CSS. All the icons are in a square format, so just set the `` tag with equal width and height dimensions. 45 | 46 | ``` 47 | .icon { 48 | width: 16px; 49 | height: 16px; 50 | } 51 | ``` 52 | 53 | Coloring icons is even easier. All you need to do is set the `fill` rule on the `` tag. 54 | 55 | ``` 56 | .icon-account-login { 57 | fill: #f00; 58 | } 59 | ``` 60 | 61 | To learn more about SVG Sprites, read [Chris Coyier's guide](http://css-tricks.com/svg-sprites-use-better-icon-fonts/). 62 | 63 | #### Using Open Iconic's Icon Font... 64 | 65 | 66 | ##### …with Bootstrap 67 | 68 | You can find our Bootstrap stylesheets in `font/css/open-iconic-bootstrap.{css, less, scss, styl}` 69 | 70 | 71 | ``` 72 | 73 | ``` 74 | 75 | 76 | ``` 77 | 78 | ``` 79 | 80 | ##### …with Foundation 81 | 82 | You can find our Foundation stylesheets in `font/css/open-iconic-foundation.{css, less, scss, styl}` 83 | 84 | ``` 85 | 86 | ``` 87 | 88 | 89 | ``` 90 | 91 | ``` 92 | 93 | ##### …on its own 94 | 95 | You can find our default stylesheets in `font/css/open-iconic.{css, less, scss, styl}` 96 | 97 | ``` 98 | 99 | ``` 100 | 101 | ``` 102 | 103 | ``` 104 | 105 | 106 | ## License 107 | 108 | ### Icons 109 | 110 | All code (including SVG markup) is under the [MIT License](http://opensource.org/licenses/MIT). 111 | 112 | ### Fonts 113 | 114 | All fonts are under the [SIL Licensed](http://scripts.sil.org/cms/scripts/page.php?item_id=OFL_web). 115 | -------------------------------------------------------------------------------- /Samples/01/BlazorApp/wwwroot/css/app.css: -------------------------------------------------------------------------------- 1 | @import url('open-iconic/font/css/open-iconic-bootstrap.min.css'); 2 | 3 | html, body { 4 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 5 | } 6 | 7 | a, .btn-link { 8 | color: #0366d6; 9 | } 10 | 11 | .btn-primary { 12 | color: #fff; 13 | background-color: #1b6ec2; 14 | border-color: #1861ac; 15 | } 16 | 17 | app { 18 | position: relative; 19 | display: flex; 20 | flex-direction: column; 21 | } 22 | 23 | .top-row { 24 | height: 3.5rem; 25 | display: flex; 26 | align-items: center; 27 | } 28 | 29 | .main { 30 | flex: 1; 31 | } 32 | 33 | .main .top-row { 34 | background-color: #f7f7f7; 35 | border-bottom: 1px solid #d6d5d5; 36 | justify-content: flex-end; 37 | } 38 | 39 | .main .top-row > a, .main .top-row .btn-link { 40 | white-space: nowrap; 41 | margin-left: 1.5rem; 42 | } 43 | 44 | .main .top-row a:first-child { 45 | overflow: hidden; 46 | text-overflow: ellipsis; 47 | } 48 | 49 | .sidebar { 50 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); 51 | } 52 | 53 | .sidebar .top-row { 54 | background-color: rgba(0,0,0,0.4); 55 | } 56 | 57 | .sidebar .navbar-brand { 58 | font-size: 1.1rem; 59 | } 60 | 61 | .sidebar .oi { 62 | width: 2rem; 63 | font-size: 1.1rem; 64 | vertical-align: text-top; 65 | top: -2px; 66 | } 67 | 68 | .sidebar .nav-item { 69 | font-size: 0.9rem; 70 | padding-bottom: 0.5rem; 71 | } 72 | 73 | .sidebar .nav-item:first-of-type { 74 | padding-top: 1rem; 75 | } 76 | 77 | .sidebar .nav-item:last-of-type { 78 | padding-bottom: 1rem; 79 | } 80 | 81 | .sidebar .nav-item a { 82 | color: #d7d7d7; 83 | border-radius: 4px; 84 | height: 3rem; 85 | display: flex; 86 | align-items: center; 87 | line-height: 3rem; 88 | } 89 | 90 | .sidebar .nav-item a.active { 91 | background-color: rgba(255,255,255,0.25); 92 | color: white; 93 | } 94 | 95 | .sidebar .nav-item a:hover { 96 | background-color: rgba(255,255,255,0.1); 97 | color: white; 98 | } 99 | 100 | .content { 101 | padding-top: 1.1rem; 102 | } 103 | 104 | .navbar-toggler { 105 | background-color: rgba(255, 255, 255, 0.1); 106 | } 107 | 108 | .valid.modified:not([type=checkbox]) { 109 | outline: 1px solid #26b050; 110 | } 111 | 112 | .invalid { 113 | outline: 1px solid red; 114 | } 115 | 116 | .validation-message { 117 | color: red; 118 | } 119 | 120 | #blazor-error-ui { 121 | background: lightyellow; 122 | bottom: 0; 123 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 124 | display: none; 125 | left: 0; 126 | padding: 0.6rem 1.25rem 0.7rem 1.25rem; 127 | position: fixed; 128 | width: 100%; 129 | z-index: 1000; 130 | } 131 | 132 | #blazor-error-ui .dismiss { 133 | cursor: pointer; 134 | position: absolute; 135 | right: 0.75rem; 136 | top: 0.5rem; 137 | } 138 | 139 | @media (max-width: 767.98px) { 140 | .main .top-row:not(.auth) { 141 | display: none; 142 | } 143 | 144 | .main .top-row.auth { 145 | justify-content: space-between; 146 | } 147 | 148 | .main .top-row a, .main .top-row .btn-link { 149 | margin-left: 0; 150 | } 151 | } 152 | 153 | @media (min-width: 768px) { 154 | app { 155 | flex-direction: row; 156 | } 157 | 158 | .sidebar { 159 | width: 250px; 160 | height: 100vh; 161 | position: sticky; 162 | top: 0; 163 | } 164 | 165 | .main .top-row { 166 | position: sticky; 167 | top: 0; 168 | } 169 | 170 | .main > div { 171 | padding-left: 2rem !important; 172 | padding-right: 1.5rem !important; 173 | } 174 | 175 | .navbar-toggler { 176 | display: none; 177 | } 178 | 179 | .sidebar .collapse { 180 | /* Never collapse the sidebar for wide screens */ 181 | display: block; 182 | } 183 | } 184 | -------------------------------------------------------------------------------- /Samples/01/BlazorApp/wwwroot/css/open-iconic/FONT-LICENSE: -------------------------------------------------------------------------------- 1 | SIL OPEN FONT LICENSE Version 1.1 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | PREAMBLE 6 | The goals of the Open Font License (OFL) are to stimulate worldwide 7 | development of collaborative font projects, to support the font creation 8 | efforts of academic and linguistic communities, and to provide a free and 9 | open framework in which fonts may be shared and improved in partnership 10 | with others. 11 | 12 | The OFL allows the licensed fonts to be used, studied, modified and 13 | redistributed freely as long as they are not sold by themselves. The 14 | fonts, including any derivative works, can be bundled, embedded, 15 | redistributed and/or sold with any software provided that any reserved 16 | names are not used by derivative works. The fonts and derivatives, 17 | however, cannot be released under any other type of license. The 18 | requirement for fonts to remain under this license does not apply 19 | to any document created using the fonts or their derivatives. 20 | 21 | DEFINITIONS 22 | "Font Software" refers to the set of files released by the Copyright 23 | Holder(s) under this license and clearly marked as such. This may 24 | include source files, build scripts and documentation. 25 | 26 | "Reserved Font Name" refers to any names specified as such after the 27 | copyright statement(s). 28 | 29 | "Original Version" refers to the collection of Font Software components as 30 | distributed by the Copyright Holder(s). 31 | 32 | "Modified Version" refers to any derivative made by adding to, deleting, 33 | or substituting -- in part or in whole -- any of the components of the 34 | Original Version, by changing formats or by porting the Font Software to a 35 | new environment. 36 | 37 | "Author" refers to any designer, engineer, programmer, technical 38 | writer or other person who contributed to the Font Software. 39 | 40 | PERMISSION & CONDITIONS 41 | Permission is hereby granted, free of charge, to any person obtaining 42 | a copy of the Font Software, to use, study, copy, merge, embed, modify, 43 | redistribute, and sell modified and unmodified copies of the Font 44 | Software, subject to the following conditions: 45 | 46 | 1) Neither the Font Software nor any of its individual components, 47 | in Original or Modified Versions, may be sold by itself. 48 | 49 | 2) Original or Modified Versions of the Font Software may be bundled, 50 | redistributed and/or sold with any software, provided that each copy 51 | contains the above copyright notice and this license. These can be 52 | included either as stand-alone text files, human-readable headers or 53 | in the appropriate machine-readable metadata fields within text or 54 | binary files as long as those fields can be easily viewed by the user. 55 | 56 | 3) No Modified Version of the Font Software may use the Reserved Font 57 | Name(s) unless explicit written permission is granted by the corresponding 58 | Copyright Holder. This restriction only applies to the primary font name as 59 | presented to the users. 60 | 61 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font 62 | Software shall not be used to promote, endorse or advertise any 63 | Modified Version, except to acknowledge the contribution(s) of the 64 | Copyright Holder(s) and the Author(s) or with their explicit written 65 | permission. 66 | 67 | 5) The Font Software, modified or unmodified, in part or in whole, 68 | must be distributed entirely under this license, and must not be 69 | distributed under any other license. The requirement for fonts to 70 | remain under this license does not apply to any document created 71 | using the Font Software. 72 | 73 | TERMINATION 74 | This license becomes null and void if any of the above conditions are 75 | not met. 76 | 77 | DISCLAIMER 78 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 79 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF 80 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 81 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE 82 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 83 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL 84 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 85 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM 86 | OTHER DEALINGS IN THE FONT SOFTWARE. 87 | -------------------------------------------------------------------------------- /src/BlazorLazyLoad/RouterLL.cs: -------------------------------------------------------------------------------- 1 | #region using 2 | using Microsoft.AspNetCore.Components; 3 | using Microsoft.AspNetCore.Components.Routing; 4 | using Microsoft.Extensions.Logging; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Net.Http; 8 | using System.Reflection; 9 | using System.Threading.Tasks; 10 | #endregion using 11 | 12 | namespace BlazorLazyLoad 13 | { 14 | public class RouterLL:IComponent, IHandleAfterRender, IDisposable, IRouterEnvelope 15 | { 16 | readonly Router _router=new Router(); 17 | readonly static MethodInfo _routerNavigationManagerGetter, _routerNavigationManagerSetter; 18 | readonly static MethodInfo _routerNavigationInterceptionGetter, _routerNavigationInterceptionSetter; 19 | readonly static MethodInfo _routerLoggerFactoryGetter, _routerLoggerFactorySetter; 20 | 21 | static RouterLL() 22 | { 23 | Type type = typeof(Router); 24 | PropertyInfo pi = type.GetProperty("NavigationManager",BindingFlags.NonPublic|BindingFlags.Instance); 25 | _routerNavigationManagerGetter=pi.GetGetMethod(true); 26 | _routerNavigationManagerSetter=pi.GetSetMethod(true); 27 | pi = type.GetProperty("NavigationInterception",BindingFlags.NonPublic|BindingFlags.Instance); 28 | _routerNavigationInterceptionGetter=pi.GetGetMethod(true); 29 | _routerNavigationInterceptionSetter=pi.GetSetMethod(true); 30 | pi = type.GetProperty("LoggerFactory",BindingFlags.NonPublic|BindingFlags.Instance); 31 | _routerLoggerFactoryGetter=pi.GetGetMethod(true); 32 | _routerLoggerFactorySetter=pi.GetSetMethod(true); 33 | } 34 | 35 | #pragma warning disable BL0005 36 | [Parameter] 37 | public Assembly AppAssembly { get { return _router.AppAssembly; } set { _router.AppAssembly=value; } } 38 | 39 | [Parameter] 40 | public IEnumerable AdditionalAssemblies { get { return _router.AdditionalAssemblies; } set { _router.AdditionalAssemblies=value; } } 41 | 42 | [Parameter] 43 | public RenderFragment NotFound { get { return _router.NotFound; } set { _router.NotFound=value; } } 44 | 45 | [Parameter] 46 | public RenderFragment Found { get { return _router.Found; } set { _router.Found=value; } } 47 | #pragma warning restore BL0005 48 | 49 | [Inject] 50 | private NavigationManager NavigationManager 51 | { 52 | get => (NavigationManager)_routerNavigationManagerGetter.Invoke(_router,new object[0]); 53 | set => _routerNavigationManagerSetter.Invoke(_router,new object[] { value }); 54 | } 55 | 56 | [Inject] 57 | private INavigationInterception NavigationInterception 58 | { 59 | get => (INavigationInterception)_routerNavigationInterceptionGetter.Invoke(_router,new object[0]); 60 | set => _routerNavigationInterceptionSetter.Invoke(_router,new object[] { value }); 61 | } 62 | 63 | [Inject] 64 | private ILoggerFactory LoggerFactory 65 | { 66 | get => (ILoggerFactory)_routerLoggerFactoryGetter.Invoke(_router,new object[0]); 67 | set => _routerLoggerFactorySetter.Invoke(_router,new object[] { value }); 68 | } 69 | 70 | [Inject] IAssemblyLazyLoadResolver AssemblyLazyLoadResolver { get; set; } 71 | 72 | public void Attach(RenderHandle renderHandle) 73 | => _router.Attach(renderHandle); 74 | 75 | public void Dispose() 76 | => _router.Dispose(); 77 | 78 | int _phase = 0; 79 | IDictionary _parms=null; 80 | 81 | public async Task SetParametersAsync(ParameterView parameters) 82 | { 83 | if (_phase==0) //called from Blazor 84 | { 85 | JSInteropMethods.Router=this; 86 | parameters.SetParameterProperties(this); 87 | _parms=new Dictionary(parameters.ToDictionary()); 88 | _phase=1; 89 | string url = new Uri(NavigationManager.Uri,UriKind.RelativeOrAbsolute).AbsoluteUri; 90 | await AssemblyLazyLoadResolver.ResolveAsync(url,true); 91 | _phase=2; 92 | await _router.SetParametersAsync(ParameterView.FromDictionary(_parms)); 93 | } 94 | else if (_phase==1) //called from AssemblyLazyLoadResolver 95 | _parms=new Dictionary(parameters.ToDictionary()); 96 | else //through the parameters directly to the real router 97 | await _router.SetParametersAsync(parameters); 98 | } 99 | 100 | public Task OnAfterRenderAsync() 101 | => ((IHandleAfterRender)_router).OnAfterRenderAsync(); 102 | 103 | [Inject] HttpClient HttpClient { get; set; } 104 | } 105 | 106 | public interface IRouterEnvelope:IComponent 107 | { 108 | IEnumerable AdditionalAssemblies { get; set; } 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Aa][Rr][Mm]/ 27 | [Aa][Rr][Mm]64/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Ll]og/ 32 | [Ll]ogs/ 33 | 34 | # Visual Studio 2015/2017 cache/options directory 35 | .vs/ 36 | # Uncomment if you have tasks that create the project's static files in wwwroot 37 | #wwwroot/ 38 | 39 | # Visual Studio 2017 auto generated files 40 | Generated\ Files/ 41 | 42 | # MSTest test Results 43 | [Tt]est[Rr]esult*/ 44 | [Bb]uild[Ll]og.* 45 | 46 | # NUnit 47 | *.VisualState.xml 48 | TestResult.xml 49 | nunit-*.xml 50 | 51 | # Build Results of an ATL Project 52 | [Dd]ebugPS/ 53 | [Rr]eleasePS/ 54 | dlldata.c 55 | 56 | # Benchmark Results 57 | BenchmarkDotNet.Artifacts/ 58 | 59 | # .NET Core 60 | project.lock.json 61 | project.fragment.lock.json 62 | artifacts/ 63 | 64 | # StyleCop 65 | StyleCopReport.xml 66 | 67 | # Files built by Visual Studio 68 | *_i.c 69 | *_p.c 70 | *_h.h 71 | *.ilk 72 | *.meta 73 | *.obj 74 | *.iobj 75 | *.pch 76 | *.pdb 77 | *.ipdb 78 | *.pgc 79 | *.pgd 80 | *.rsp 81 | *.sbr 82 | *.tlb 83 | *.tli 84 | *.tlh 85 | *.tmp 86 | *.tmp_proj 87 | *_wpftmp.csproj 88 | *.log 89 | *.vspscc 90 | *.vssscc 91 | .builds 92 | *.pidb 93 | *.svclog 94 | *.scc 95 | 96 | # Chutzpah Test files 97 | _Chutzpah* 98 | 99 | # Visual C++ cache files 100 | ipch/ 101 | *.aps 102 | *.ncb 103 | *.opendb 104 | *.opensdf 105 | *.sdf 106 | *.cachefile 107 | *.VC.db 108 | *.VC.VC.opendb 109 | 110 | # Visual Studio profiler 111 | *.psess 112 | *.vsp 113 | *.vspx 114 | *.sap 115 | 116 | # Visual Studio Trace Files 117 | *.e2e 118 | 119 | # TFS 2012 Local Workspace 120 | $tf/ 121 | 122 | # Guidance Automation Toolkit 123 | *.gpState 124 | 125 | # ReSharper is a .NET coding add-in 126 | _ReSharper*/ 127 | *.[Rr]e[Ss]harper 128 | *.DotSettings.user 129 | 130 | # TeamCity is a build add-in 131 | _TeamCity* 132 | 133 | # DotCover is a Code Coverage Tool 134 | *.dotCover 135 | 136 | # AxoCover is a Code Coverage Tool 137 | .axoCover/* 138 | !.axoCover/settings.json 139 | 140 | # Visual Studio code coverage results 141 | *.coverage 142 | *.coveragexml 143 | 144 | # NCrunch 145 | _NCrunch_* 146 | .*crunch*.local.xml 147 | nCrunchTemp_* 148 | 149 | # MightyMoose 150 | *.mm.* 151 | AutoTest.Net/ 152 | 153 | # Web workbench (sass) 154 | .sass-cache/ 155 | 156 | # Installshield output folder 157 | [Ee]xpress/ 158 | 159 | # DocProject is a documentation generator add-in 160 | DocProject/buildhelp/ 161 | DocProject/Help/*.HxT 162 | DocProject/Help/*.HxC 163 | DocProject/Help/*.hhc 164 | DocProject/Help/*.hhk 165 | DocProject/Help/*.hhp 166 | DocProject/Help/Html2 167 | DocProject/Help/html 168 | 169 | # Click-Once directory 170 | publish/ 171 | 172 | # Publish Web Output 173 | *.[Pp]ublish.xml 174 | *.azurePubxml 175 | # Note: Comment the next line if you want to checkin your web deploy settings, 176 | # but database connection strings (with potential passwords) will be unencrypted 177 | *.pubxml 178 | *.publishproj 179 | 180 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 181 | # checkin your Azure Web App publish settings, but sensitive information contained 182 | # in these scripts will be unencrypted 183 | PublishScripts/ 184 | 185 | # NuGet Packages 186 | *.nupkg 187 | # NuGet Symbol Packages 188 | *.snupkg 189 | # The packages folder can be ignored because of Package Restore 190 | **/[Pp]ackages/* 191 | # except build/, which is used as an MSBuild target. 192 | !**/[Pp]ackages/build/ 193 | # Uncomment if necessary however generally it will be regenerated when needed 194 | #!**/[Pp]ackages/repositories.config 195 | # NuGet v3's project.json files produces more ignorable files 196 | *.nuget.props 197 | *.nuget.targets 198 | 199 | # Microsoft Azure Build Output 200 | csx/ 201 | *.build.csdef 202 | 203 | # Microsoft Azure Emulator 204 | ecf/ 205 | rcf/ 206 | 207 | # Windows Store app package directories and files 208 | AppPackages/ 209 | BundleArtifacts/ 210 | Package.StoreAssociation.xml 211 | _pkginfo.txt 212 | *.appx 213 | *.appxbundle 214 | *.appxupload 215 | 216 | # Visual Studio cache files 217 | # files ending in .cache can be ignored 218 | *.[Cc]ache 219 | # but keep track of directories ending in .cache 220 | !?*.[Cc]ache/ 221 | 222 | # Others 223 | ClientBin/ 224 | ~$* 225 | *~ 226 | *.dbmdl 227 | *.dbproj.schemaview 228 | *.jfm 229 | *.pfx 230 | *.publishsettings 231 | orleans.codegen.cs 232 | 233 | # Including strong name files can present a security risk 234 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 235 | #*.snk 236 | 237 | # Since there are multiple workflows, uncomment next line to ignore bower_components 238 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 239 | #bower_components/ 240 | 241 | # RIA/Silverlight projects 242 | Generated_Code/ 243 | 244 | # Backup & report files from converting an old project file 245 | # to a newer Visual Studio version. Backup files are not needed, 246 | # because we have git ;-) 247 | _UpgradeReport_Files/ 248 | Backup*/ 249 | UpgradeLog*.XML 250 | UpgradeLog*.htm 251 | ServiceFabricBackup/ 252 | *.rptproj.bak 253 | 254 | # SQL Server files 255 | *.mdf 256 | *.ldf 257 | *.ndf 258 | 259 | # Business Intelligence projects 260 | *.rdl.data 261 | *.bim.layout 262 | *.bim_*.settings 263 | *.rptproj.rsuser 264 | *- [Bb]ackup.rdl 265 | *- [Bb]ackup ([0-9]).rdl 266 | *- [Bb]ackup ([0-9][0-9]).rdl 267 | 268 | # Microsoft Fakes 269 | FakesAssemblies/ 270 | 271 | # GhostDoc plugin setting file 272 | *.GhostDoc.xml 273 | 274 | # Node.js Tools for Visual Studio 275 | .ntvs_analysis.dat 276 | node_modules/ 277 | 278 | # Visual Studio 6 build log 279 | *.plg 280 | 281 | # Visual Studio 6 workspace options file 282 | *.opt 283 | 284 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 285 | *.vbw 286 | 287 | # Visual Studio LightSwitch build output 288 | **/*.HTMLClient/GeneratedArtifacts 289 | **/*.DesktopClient/GeneratedArtifacts 290 | **/*.DesktopClient/ModelManifest.xml 291 | **/*.Server/GeneratedArtifacts 292 | **/*.Server/ModelManifest.xml 293 | _Pvt_Extensions 294 | 295 | # Paket dependency manager 296 | .paket/paket.exe 297 | paket-files/ 298 | 299 | # FAKE - F# Make 300 | .fake/ 301 | 302 | # CodeRush personal settings 303 | .cr/personal 304 | 305 | # Python Tools for Visual Studio (PTVS) 306 | __pycache__/ 307 | *.pyc 308 | 309 | # Cake - Uncomment if you are using it 310 | # tools/** 311 | # !tools/packages.config 312 | 313 | # Tabs Studio 314 | *.tss 315 | 316 | # Telerik's JustMock configuration file 317 | *.jmconfig 318 | 319 | # BizTalk build output 320 | *.btp.cs 321 | *.btm.cs 322 | *.odx.cs 323 | *.xsd.cs 324 | 325 | # OpenCover UI analysis results 326 | OpenCover/ 327 | 328 | # Azure Stream Analytics local run output 329 | ASALocalRun/ 330 | 331 | # MSBuild Binary and Structured Log 332 | *.binlog 333 | 334 | # NVidia Nsight GPU debugger configuration file 335 | *.nvuser 336 | 337 | # MFractors (Xamarin productivity tool) working folder 338 | .mfractor/ 339 | 340 | # Local History for Visual Studio 341 | .localhistory/ 342 | 343 | # BeatPulse healthcheck temp database 344 | healthchecksdb 345 | 346 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 347 | MigrationBackup/ 348 | 349 | # Ionide (cross platform F# VS Code tools) working folder 350 | .ionide/ 351 | -------------------------------------------------------------------------------- /Samples/01/BlazorApp/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css: -------------------------------------------------------------------------------- 1 | @font-face{font-family:Icons;src:url(../fonts/open-iconic.eot);src:url(../fonts/open-iconic.eot?#iconic-sm) format('embedded-opentype'),url(../fonts/open-iconic.woff) format('woff'),url(../fonts/open-iconic.ttf) format('truetype'),url(../fonts/open-iconic.otf) format('opentype'),url(../fonts/open-iconic.svg#iconic-sm) format('svg');font-weight:400;font-style:normal}.oi{position:relative;top:1px;display:inline-block;speak:none;font-family:Icons;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.oi:empty:before{width:1em;text-align:center;box-sizing:content-box}.oi.oi-align-center:before{text-align:center}.oi.oi-align-left:before{text-align:left}.oi.oi-align-right:before{text-align:right}.oi.oi-flip-horizontal:before{-webkit-transform:scale(-1,1);-ms-transform:scale(-1,1);transform:scale(-1,1)}.oi.oi-flip-vertical:before{-webkit-transform:scale(1,-1);-ms-transform:scale(-1,1);transform:scale(1,-1)}.oi.oi-flip-horizontal-vertical:before{-webkit-transform:scale(-1,-1);-ms-transform:scale(-1,1);transform:scale(-1,-1)}.oi-account-login:before{content:'\e000'}.oi-account-logout:before{content:'\e001'}.oi-action-redo:before{content:'\e002'}.oi-action-undo:before{content:'\e003'}.oi-align-center:before{content:'\e004'}.oi-align-left:before{content:'\e005'}.oi-align-right:before{content:'\e006'}.oi-aperture:before{content:'\e007'}.oi-arrow-bottom:before{content:'\e008'}.oi-arrow-circle-bottom:before{content:'\e009'}.oi-arrow-circle-left:before{content:'\e00a'}.oi-arrow-circle-right:before{content:'\e00b'}.oi-arrow-circle-top:before{content:'\e00c'}.oi-arrow-left:before{content:'\e00d'}.oi-arrow-right:before{content:'\e00e'}.oi-arrow-thick-bottom:before{content:'\e00f'}.oi-arrow-thick-left:before{content:'\e010'}.oi-arrow-thick-right:before{content:'\e011'}.oi-arrow-thick-top:before{content:'\e012'}.oi-arrow-top:before{content:'\e013'}.oi-audio-spectrum:before{content:'\e014'}.oi-audio:before{content:'\e015'}.oi-badge:before{content:'\e016'}.oi-ban:before{content:'\e017'}.oi-bar-chart:before{content:'\e018'}.oi-basket:before{content:'\e019'}.oi-battery-empty:before{content:'\e01a'}.oi-battery-full:before{content:'\e01b'}.oi-beaker:before{content:'\e01c'}.oi-bell:before{content:'\e01d'}.oi-bluetooth:before{content:'\e01e'}.oi-bold:before{content:'\e01f'}.oi-bolt:before{content:'\e020'}.oi-book:before{content:'\e021'}.oi-bookmark:before{content:'\e022'}.oi-box:before{content:'\e023'}.oi-briefcase:before{content:'\e024'}.oi-british-pound:before{content:'\e025'}.oi-browser:before{content:'\e026'}.oi-brush:before{content:'\e027'}.oi-bug:before{content:'\e028'}.oi-bullhorn:before{content:'\e029'}.oi-calculator:before{content:'\e02a'}.oi-calendar:before{content:'\e02b'}.oi-camera-slr:before{content:'\e02c'}.oi-caret-bottom:before{content:'\e02d'}.oi-caret-left:before{content:'\e02e'}.oi-caret-right:before{content:'\e02f'}.oi-caret-top:before{content:'\e030'}.oi-cart:before{content:'\e031'}.oi-chat:before{content:'\e032'}.oi-check:before{content:'\e033'}.oi-chevron-bottom:before{content:'\e034'}.oi-chevron-left:before{content:'\e035'}.oi-chevron-right:before{content:'\e036'}.oi-chevron-top:before{content:'\e037'}.oi-circle-check:before{content:'\e038'}.oi-circle-x:before{content:'\e039'}.oi-clipboard:before{content:'\e03a'}.oi-clock:before{content:'\e03b'}.oi-cloud-download:before{content:'\e03c'}.oi-cloud-upload:before{content:'\e03d'}.oi-cloud:before{content:'\e03e'}.oi-cloudy:before{content:'\e03f'}.oi-code:before{content:'\e040'}.oi-cog:before{content:'\e041'}.oi-collapse-down:before{content:'\e042'}.oi-collapse-left:before{content:'\e043'}.oi-collapse-right:before{content:'\e044'}.oi-collapse-up:before{content:'\e045'}.oi-command:before{content:'\e046'}.oi-comment-square:before{content:'\e047'}.oi-compass:before{content:'\e048'}.oi-contrast:before{content:'\e049'}.oi-copywriting:before{content:'\e04a'}.oi-credit-card:before{content:'\e04b'}.oi-crop:before{content:'\e04c'}.oi-dashboard:before{content:'\e04d'}.oi-data-transfer-download:before{content:'\e04e'}.oi-data-transfer-upload:before{content:'\e04f'}.oi-delete:before{content:'\e050'}.oi-dial:before{content:'\e051'}.oi-document:before{content:'\e052'}.oi-dollar:before{content:'\e053'}.oi-double-quote-sans-left:before{content:'\e054'}.oi-double-quote-sans-right:before{content:'\e055'}.oi-double-quote-serif-left:before{content:'\e056'}.oi-double-quote-serif-right:before{content:'\e057'}.oi-droplet:before{content:'\e058'}.oi-eject:before{content:'\e059'}.oi-elevator:before{content:'\e05a'}.oi-ellipses:before{content:'\e05b'}.oi-envelope-closed:before{content:'\e05c'}.oi-envelope-open:before{content:'\e05d'}.oi-euro:before{content:'\e05e'}.oi-excerpt:before{content:'\e05f'}.oi-expand-down:before{content:'\e060'}.oi-expand-left:before{content:'\e061'}.oi-expand-right:before{content:'\e062'}.oi-expand-up:before{content:'\e063'}.oi-external-link:before{content:'\e064'}.oi-eye:before{content:'\e065'}.oi-eyedropper:before{content:'\e066'}.oi-file:before{content:'\e067'}.oi-fire:before{content:'\e068'}.oi-flag:before{content:'\e069'}.oi-flash:before{content:'\e06a'}.oi-folder:before{content:'\e06b'}.oi-fork:before{content:'\e06c'}.oi-fullscreen-enter:before{content:'\e06d'}.oi-fullscreen-exit:before{content:'\e06e'}.oi-globe:before{content:'\e06f'}.oi-graph:before{content:'\e070'}.oi-grid-four-up:before{content:'\e071'}.oi-grid-three-up:before{content:'\e072'}.oi-grid-two-up:before{content:'\e073'}.oi-hard-drive:before{content:'\e074'}.oi-header:before{content:'\e075'}.oi-headphones:before{content:'\e076'}.oi-heart:before{content:'\e077'}.oi-home:before{content:'\e078'}.oi-image:before{content:'\e079'}.oi-inbox:before{content:'\e07a'}.oi-infinity:before{content:'\e07b'}.oi-info:before{content:'\e07c'}.oi-italic:before{content:'\e07d'}.oi-justify-center:before{content:'\e07e'}.oi-justify-left:before{content:'\e07f'}.oi-justify-right:before{content:'\e080'}.oi-key:before{content:'\e081'}.oi-laptop:before{content:'\e082'}.oi-layers:before{content:'\e083'}.oi-lightbulb:before{content:'\e084'}.oi-link-broken:before{content:'\e085'}.oi-link-intact:before{content:'\e086'}.oi-list-rich:before{content:'\e087'}.oi-list:before{content:'\e088'}.oi-location:before{content:'\e089'}.oi-lock-locked:before{content:'\e08a'}.oi-lock-unlocked:before{content:'\e08b'}.oi-loop-circular:before{content:'\e08c'}.oi-loop-square:before{content:'\e08d'}.oi-loop:before{content:'\e08e'}.oi-magnifying-glass:before{content:'\e08f'}.oi-map-marker:before{content:'\e090'}.oi-map:before{content:'\e091'}.oi-media-pause:before{content:'\e092'}.oi-media-play:before{content:'\e093'}.oi-media-record:before{content:'\e094'}.oi-media-skip-backward:before{content:'\e095'}.oi-media-skip-forward:before{content:'\e096'}.oi-media-step-backward:before{content:'\e097'}.oi-media-step-forward:before{content:'\e098'}.oi-media-stop:before{content:'\e099'}.oi-medical-cross:before{content:'\e09a'}.oi-menu:before{content:'\e09b'}.oi-microphone:before{content:'\e09c'}.oi-minus:before{content:'\e09d'}.oi-monitor:before{content:'\e09e'}.oi-moon:before{content:'\e09f'}.oi-move:before{content:'\e0a0'}.oi-musical-note:before{content:'\e0a1'}.oi-paperclip:before{content:'\e0a2'}.oi-pencil:before{content:'\e0a3'}.oi-people:before{content:'\e0a4'}.oi-person:before{content:'\e0a5'}.oi-phone:before{content:'\e0a6'}.oi-pie-chart:before{content:'\e0a7'}.oi-pin:before{content:'\e0a8'}.oi-play-circle:before{content:'\e0a9'}.oi-plus:before{content:'\e0aa'}.oi-power-standby:before{content:'\e0ab'}.oi-print:before{content:'\e0ac'}.oi-project:before{content:'\e0ad'}.oi-pulse:before{content:'\e0ae'}.oi-puzzle-piece:before{content:'\e0af'}.oi-question-mark:before{content:'\e0b0'}.oi-rain:before{content:'\e0b1'}.oi-random:before{content:'\e0b2'}.oi-reload:before{content:'\e0b3'}.oi-resize-both:before{content:'\e0b4'}.oi-resize-height:before{content:'\e0b5'}.oi-resize-width:before{content:'\e0b6'}.oi-rss-alt:before{content:'\e0b7'}.oi-rss:before{content:'\e0b8'}.oi-script:before{content:'\e0b9'}.oi-share-boxed:before{content:'\e0ba'}.oi-share:before{content:'\e0bb'}.oi-shield:before{content:'\e0bc'}.oi-signal:before{content:'\e0bd'}.oi-signpost:before{content:'\e0be'}.oi-sort-ascending:before{content:'\e0bf'}.oi-sort-descending:before{content:'\e0c0'}.oi-spreadsheet:before{content:'\e0c1'}.oi-star:before{content:'\e0c2'}.oi-sun:before{content:'\e0c3'}.oi-tablet:before{content:'\e0c4'}.oi-tag:before{content:'\e0c5'}.oi-tags:before{content:'\e0c6'}.oi-target:before{content:'\e0c7'}.oi-task:before{content:'\e0c8'}.oi-terminal:before{content:'\e0c9'}.oi-text:before{content:'\e0ca'}.oi-thumb-down:before{content:'\e0cb'}.oi-thumb-up:before{content:'\e0cc'}.oi-timer:before{content:'\e0cd'}.oi-transfer:before{content:'\e0ce'}.oi-trash:before{content:'\e0cf'}.oi-underline:before{content:'\e0d0'}.oi-vertical-align-bottom:before{content:'\e0d1'}.oi-vertical-align-center:before{content:'\e0d2'}.oi-vertical-align-top:before{content:'\e0d3'}.oi-video:before{content:'\e0d4'}.oi-volume-high:before{content:'\e0d5'}.oi-volume-low:before{content:'\e0d6'}.oi-volume-off:before{content:'\e0d7'}.oi-warning:before{content:'\e0d8'}.oi-wifi:before{content:'\e0d9'}.oi-wrench:before{content:'\e0da'}.oi-x:before{content:'\e0db'}.oi-yen:before{content:'\e0dc'}.oi-zoom-in:before{content:'\e0dd'}.oi-zoom-out:before{content:'\e0de'} -------------------------------------------------------------------------------- /Samples/01/BlazorApp/wwwroot/css/open-iconic/font/fonts/open-iconic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | Created by FontForge 20120731 at Tue Jul 1 20:39:22 2014 9 | By P.J. Onori 10 | Created by P.J. Onori with FontForge 2.0 (http://fontforge.sf.net) 11 | 12 | 13 | 14 | 27 | 28 | 30 | 32 | 34 | 36 | 38 | 40 | 42 | 45 | 47 | 49 | 51 | 53 | 55 | 57 | 59 | 61 | 63 | 65 | 67 | 69 | 71 | 74 | 76 | 79 | 81 | 84 | 86 | 88 | 91 | 93 | 95 | 98 | 100 | 102 | 104 | 106 | 109 | 112 | 115 | 117 | 121 | 123 | 125 | 127 | 130 | 132 | 134 | 136 | 138 | 141 | 143 | 145 | 147 | 149 | 151 | 153 | 155 | 157 | 159 | 162 | 165 | 167 | 169 | 172 | 174 | 177 | 179 | 181 | 183 | 185 | 189 | 191 | 194 | 196 | 198 | 200 | 202 | 205 | 207 | 209 | 211 | 213 | 215 | 218 | 220 | 222 | 224 | 226 | 228 | 230 | 232 | 234 | 236 | 238 | 241 | 243 | 245 | 247 | 249 | 251 | 253 | 256 | 259 | 261 | 263 | 265 | 267 | 269 | 272 | 274 | 276 | 280 | 282 | 285 | 287 | 289 | 292 | 295 | 298 | 300 | 302 | 304 | 306 | 309 | 312 | 314 | 316 | 318 | 320 | 322 | 324 | 326 | 330 | 334 | 338 | 340 | 343 | 345 | 347 | 349 | 351 | 353 | 355 | 358 | 360 | 363 | 365 | 367 | 369 | 371 | 373 | 375 | 377 | 379 | 381 | 383 | 386 | 388 | 390 | 392 | 394 | 396 | 399 | 401 | 404 | 406 | 408 | 410 | 412 | 414 | 416 | 419 | 421 | 423 | 425 | 428 | 431 | 435 | 438 | 440 | 442 | 444 | 446 | 448 | 451 | 453 | 455 | 457 | 460 | 462 | 464 | 466 | 468 | 471 | 473 | 477 | 479 | 481 | 483 | 486 | 488 | 490 | 492 | 494 | 496 | 499 | 501 | 504 | 506 | 509 | 512 | 515 | 517 | 520 | 522 | 524 | 526 | 529 | 532 | 534 | 536 | 539 | 542 | 543 | 544 | --------------------------------------------------------------------------------