11
22# BlazorEmbedLibrary
33
4- This is a component library that provides Blazor-style static file embedding for Razor Components.
4+ This is a component library that provides Blazor-style static file embedding for Razor Components/Blazor .
55
6- Projects in this repo:
7-
8- ## BlazorEmbedLibrary
6+ Chanegelog:
97
10- This is the component library that provides all the functionality.
11-
12- It is a netstandard component library (i.e. a netstandard2.0 library) with one c# code file.
8+ #### Version 0.1.0-beta-3
9+ - Restructure source folders
10+ - Add ability to handle multiple component assemblies in one go
11+ - Add ability to block specific content files
12+ -- Including in Blazor
1313
14- ### BlazorComponentSample
15-
16- An out-of-the-box sample Blazor component library with static files.
17-
18- ### BlazorEmbedContent - Runnable
14+ #### Version 0.1.0-beta-2
15+ - Add compatibility with Pre-Rendering
1916
20- A sample Blazor app to show how this library detects if Blazor has already linked the static files, and does not duplicate them.
17+ #### Version 0.1.0-beta-1
18+ - Initial release
19+ - Enable support for embedded content files (CSS/JS) in Razor Components
2120
22- ### RazorComponentsSample.App
21+ Projects in this repo:
2322
24- A sample Razor Components app to show static files working.
23+ ## BlazorEmbedLibrary
2524
26- ### RazorComponentsSample.Server - Runnable
25+ This is the component library that provides all the functionality.
2726
28- A sample Razor Components server to show static files working .
27+ It is a netstandard component library (i.e. a netstandard2.0 library) with one c# code file .
2928
3029## How to use this library
3130
@@ -50,7 +49,66 @@ Note, by default the EmbeddedContent component has Debug turned off - if you ena
5049
5150This will read any CSS or Js files, which are embedded resources, from the Component1 library and add them to the ` head ` of the document.
5251
53- ## Examples
52+ ### Multiple Assemblies
53+
54+ From version 0.1.0-beta-3 onwards, you can now handle multiple component libraries in one hit using the Assemblies Parameter
55+
56+ ```
57+ <EmbeddedContent Assemblies="@Assemblies" />
58+
59+ @functions
60+ {
61+ List<System.Reflection.Assembly> Assemblies = new List<System.Reflection.Assembly>()
62+ {
63+ typeof(BlazorComponentSample.Component1).Assembly,
64+ typeof(Blazored.Toast.BlazoredToasts).Assembly
65+ };
66+ }
67+
68+ ```
69+
70+ ### Block Files
71+
72+ From version 0.1.0-beta-3 onwards, you can now block individual files using the BlockCss Parameter
73+
74+ This example will load content from Blazored.Toast and Component1, but will block the * styles.css* from BlazorComponentSample.
75+
76+ ```
77+ <EmbeddedContent Assemblies="@Assemblies" BlockCssFiles="@BlockCss" />
78+
79+ @functions
80+ {
81+ List<string> BlockCss = new List<string>()
82+ {
83+ "BlazorComponentSample,styles.css"
84+ };
85+
86+ List<System.Reflection.Assembly> Assemblies = new List<System.Reflection.Assembly>()
87+ {
88+ typeof(BlazorComponentSample.Component1).Assembly,
89+ typeof(Blazored.Toast.BlazoredToasts).Assembly
90+ };
91+ }
92+
93+ ```
94+
95+ ## Sample Projects
96+
97+ I have included Blazored.Toast and a simple custom component in the Razorcomponents and Blazor Apps
98+
99+
100+ ### BlazorComponentSample
101+
102+ An out-of-the-box sample Blazor component library with static files.
103+
104+ ### BlazorEmbedContent - Runnable
105+
106+ A sample Blazor app to show how this library detects if Blazor has already linked the static files, and does not duplicate them.
107+
108+ Also shows how we can toggle CSS files on/off at runtime.
109+
110+ ### RazorComponentsSample.Server - Runnable
54111
55- I have included Blazored.LocalStorage and Blazored.Toast examples in the Razorcomponents App
112+ A sample Razor Components App to show static files working.
56113
114+ Also shows how we can toggle CSS files on/off at runtime.
0 commit comments