Skip to content

Commit bcba4de

Browse files
Add project files.
1 parent b6ea8b1 commit bcba4de

File tree

73 files changed

+2903
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+2903
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netstandard2.0</TargetFramework>
5+
<OutputType>Library</OutputType>
6+
<IsPackable>true</IsPackable>
7+
<BlazorLinkOnBuild>false</BlazorLinkOnBuild>
8+
<LangVersion>latest</LangVersion>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<!-- .js/.css files will be referenced via <script>/<link> tags; other content files will just be included in the app's 'dist' directory without any tags referencing them -->
13+
<EmbeddedResource Include="content\**\*.js" LogicalName="blazor:js:%(RecursiveDir)%(Filename)%(Extension)" />
14+
<EmbeddedResource Include="content\**\*.css" LogicalName="blazor:css:%(RecursiveDir)%(Filename)%(Extension)" />
15+
<EmbeddedResource Include="content\**" Exclude="**\*.js;**\*.css" LogicalName="blazor:file:%(RecursiveDir)%(Filename)%(Extension)" />
16+
</ItemGroup>
17+
18+
<ItemGroup>
19+
<PackageReference Include="Microsoft.AspNetCore.Blazor" Version="$(BlazorVersion)" />
20+
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="$(BlazorVersion)" PrivateAssets="all" />
21+
22+
<DotNetCliToolReference Include="Microsoft.AspNetCore.Blazor.Cli" Version="$(BlazorVersion)" />
23+
</ItemGroup>
24+
25+
</Project>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@using Microsoft.AspNetCore.Components
2+
@inherits ComponentBase
3+
<div class="my-component">
4+
This Blazor component is defined in the <strong>BlazorComponentSample</strong> package.
5+
</div>
6+
7+
<button onclick="@OnClick">Click Me!</button>
8+
9+
@functions
10+
{
11+
Task OnClick(UIMouseEventArgs args)
12+
{
13+
return ExampleJsInterop.Prompt("you clicked me");
14+
}
15+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using Microsoft.JSInterop;
2+
using System.Threading.Tasks;
3+
4+
namespace BlazorComponentSample
5+
{
6+
public class ExampleJsInterop
7+
{
8+
public static Task<string> Prompt(string message)
9+
{
10+
// Implemented in exampleJsInterop.js
11+
return JSRuntime.Current.InvokeAsync<string>(
12+
"exampleJsFunctions.showPrompt",
13+
message);
14+
}
15+
}
16+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"iisSettings": {
3+
"windowsAuthentication": false,
4+
"anonymousAuthentication": true,
5+
"iisExpress": {
6+
"applicationUrl": "http://localhost:58850/",
7+
"sslPort": 0
8+
}
9+
},
10+
"profiles": {
11+
"IIS Express": {
12+
"commandName": "IISExpress",
13+
"launchBrowser": true,
14+
"environmentVariables": {
15+
"ASPNETCORE_ENVIRONMENT": "Development"
16+
}
17+
},
18+
"BlazorComponentSample": {
19+
"commandName": "Project",
20+
"launchBrowser": true,
21+
"environmentVariables": {
22+
"ASPNETCORE_ENVIRONMENT": "Development"
23+
},
24+
"applicationUrl": "http://localhost:58851/"
25+
}
26+
}
27+
}
378 Bytes
Loading
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// This file is to show how a library package may provide JavaScript interop features
2+
// wrapped in a .NET API
3+
4+
window.exampleJsFunctions = {
5+
showPrompt: function (message) {
6+
return prompt(message, 'Type anything here');
7+
}
8+
};
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
This file is to show how CSS and other static resources (such as images) can be
3+
used from a library project/package.
4+
*/
5+
6+
.my-component {
7+
border: 2px dashed red;
8+
padding: 1em;
9+
margin: 1em 0;
10+
background-image: url('background.png');
11+
}

BlazorEmbedContent.sln

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.28621.142
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorEmbedContent", "BlazorEmbedContent\BlazorEmbedContent.csproj", "{C8941EE2-3131-442A-8CD4-8E3D8F05E909}"
7+
EndProject
8+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{84E71A33-28B5-485E-81CD-625ED1A95A24}"
9+
ProjectSection(SolutionItems) = preProject
10+
Directory.Build.props = Directory.Build.props
11+
README.md = README.md
12+
EndProjectSection
13+
EndProject
14+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorEmbedLibrary", "BlazorEmbedLibrary\BlazorEmbedLibrary.csproj", "{2233FEFD-906A-48BA-B449-E1206CBA7068}"
15+
EndProject
16+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorComponentSample", "BlazorComponentSample\BlazorComponentSample.csproj", "{0E5308C8-4453-44C6-93E2-434E02C5A834}"
17+
EndProject
18+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RazorComponentsSample.Server", "RazorComponentsSample\RazorComponentsSample.Server\RazorComponentsSample.Server.csproj", "{321B4834-0D15-4752-945A-350FE4F3E187}"
19+
EndProject
20+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RazorComponentsSample.App", "RazorComponentsSample\RazorComponentsSample.App\RazorComponentsSample.App.csproj", "{AF8C09AB-74C0-4227-B008-D264891ECFE3}"
21+
EndProject
22+
Global
23+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
24+
Debug|Any CPU = Debug|Any CPU
25+
Release|Any CPU = Release|Any CPU
26+
EndGlobalSection
27+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
28+
{C8941EE2-3131-442A-8CD4-8E3D8F05E909}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29+
{C8941EE2-3131-442A-8CD4-8E3D8F05E909}.Debug|Any CPU.Build.0 = Debug|Any CPU
30+
{C8941EE2-3131-442A-8CD4-8E3D8F05E909}.Release|Any CPU.ActiveCfg = Release|Any CPU
31+
{C8941EE2-3131-442A-8CD4-8E3D8F05E909}.Release|Any CPU.Build.0 = Release|Any CPU
32+
{2233FEFD-906A-48BA-B449-E1206CBA7068}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33+
{2233FEFD-906A-48BA-B449-E1206CBA7068}.Debug|Any CPU.Build.0 = Debug|Any CPU
34+
{2233FEFD-906A-48BA-B449-E1206CBA7068}.Release|Any CPU.ActiveCfg = Release|Any CPU
35+
{2233FEFD-906A-48BA-B449-E1206CBA7068}.Release|Any CPU.Build.0 = Release|Any CPU
36+
{0E5308C8-4453-44C6-93E2-434E02C5A834}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
37+
{0E5308C8-4453-44C6-93E2-434E02C5A834}.Debug|Any CPU.Build.0 = Debug|Any CPU
38+
{0E5308C8-4453-44C6-93E2-434E02C5A834}.Release|Any CPU.ActiveCfg = Release|Any CPU
39+
{0E5308C8-4453-44C6-93E2-434E02C5A834}.Release|Any CPU.Build.0 = Release|Any CPU
40+
{321B4834-0D15-4752-945A-350FE4F3E187}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
41+
{321B4834-0D15-4752-945A-350FE4F3E187}.Debug|Any CPU.Build.0 = Debug|Any CPU
42+
{321B4834-0D15-4752-945A-350FE4F3E187}.Release|Any CPU.ActiveCfg = Release|Any CPU
43+
{321B4834-0D15-4752-945A-350FE4F3E187}.Release|Any CPU.Build.0 = Release|Any CPU
44+
{AF8C09AB-74C0-4227-B008-D264891ECFE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
45+
{AF8C09AB-74C0-4227-B008-D264891ECFE3}.Debug|Any CPU.Build.0 = Debug|Any CPU
46+
{AF8C09AB-74C0-4227-B008-D264891ECFE3}.Release|Any CPU.ActiveCfg = Release|Any CPU
47+
{AF8C09AB-74C0-4227-B008-D264891ECFE3}.Release|Any CPU.Build.0 = Release|Any CPU
48+
EndGlobalSection
49+
GlobalSection(SolutionProperties) = preSolution
50+
HideSolutionNode = FALSE
51+
EndGlobalSection
52+
GlobalSection(ExtensibilityGlobals) = postSolution
53+
SolutionGuid = {DC049A56-A934-4817-8415-152E6BBBAA16}
54+
EndGlobalSection
55+
EndGlobal

BlazorEmbedContent/App.cshtml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<!--
2+
Configuring this here is temporary. Later we'll move the app config
3+
into Program.cs, and it won't be necessary to specify AppAssembly.
4+
-->
5+
<Router AppAssembly="typeof(Program).Assembly" />
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netstandard2.0</TargetFramework>
5+
<RunCommand>dotnet</RunCommand>
6+
<RunArguments>blazor serve</RunArguments>
7+
<LangVersion>7.3</LangVersion>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="Microsoft.AspNetCore.Blazor" Version="$(BlazorVersion)" />
12+
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="$(BlazorVersion)" PrivateAssets="all" />
13+
14+
<DotNetCliToolReference Include="Microsoft.AspNetCore.Blazor.Cli" Version="$(BlazorVersion)" />
15+
</ItemGroup>
16+
17+
<ItemGroup>
18+
<ProjectReference Include="..\BlazorComponentSample\BlazorComponentSample.csproj" />
19+
<ProjectReference Include="..\BlazorEmbedLibrary\BlazorEmbedLibrary.csproj" />
20+
</ItemGroup>
21+
22+
</Project>

0 commit comments

Comments
 (0)