Skip to content

Commit 684a6b2

Browse files
906270: QRCodeMargin
1 parent 70646f4 commit 684a6b2

File tree

12 files changed

+194
-0
lines changed

12 files changed

+194
-0
lines changed

KB-Samples/QRCodeMargin/App.razor

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@namespace QRCodeMargin
2+
<Router AppAssembly="@typeof(App).Assembly">
3+
<Found Context="routeData">
4+
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
5+
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
6+
</Found>
7+
<NotFound>
8+
<PageTitle>Not found</PageTitle>
9+
<LayoutView Layout="@typeof(MainLayout)">
10+
<p role="alert">Sorry, there's nothing at this address.</p>
11+
</LayoutView>
12+
</NotFound>
13+
</Router>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@inherits LayoutComponentBase
2+
@namespace QRCodeMargin
3+
<main> @Body </main>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@page "/"
2+
3+
@using Syncfusion.Blazor.BarcodeGenerator
4+
5+
<SfQRCodeGenerator Width="100px" Height="100px" Version="QRCodeVersion.Version40" Value="65213323" BackgroundColor="white" ForeColor="Red">
6+
<QRCodeGeneratorDisplayText Text="Sync-123" Font="monospace" Size="14" Alignment="Alignment.Center" Position="TextPosition.Bottom" Visibility="true">
7+
<QRCodeTextMargin Left="0" Top="0" Right="0" Bottom="10"></QRCodeTextMargin>
8+
</QRCodeGeneratorDisplayText>
9+
<QRMargin Left="0" Top="0" Right="0" Bottom="0"></QRMargin>
10+
</SfQRCodeGenerator>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
@page "/"
2+
@using Microsoft.AspNetCore.Components.Web
3+
@namespace QRCodeMargin.Pages
4+
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
5+
6+
<!DOCTYPE html>
7+
<html lang="en">
8+
<head>
9+
<meta charset="utf-8" />
10+
<base href="~/" />
11+
<link href="css/site.css" rel="stylesheet" />
12+
<component type="typeof(HeadOutlet)" render-mode="ServerPrerendered" />
13+
<script src="_content/Syncfusion.Blazor/scripts/syncfusion-blazor.min.js" type="text/javascript"></script>
14+
<link href="_content/Syncfusion.Blazor/styles/bootstrap5.css" rel="stylesheet" />
15+
</head>
16+
<body>
17+
<component type="typeof(App)" render-mode="ServerPrerendered" />
18+
19+
<div id="blazor-error-ui">
20+
<environment include="Staging,Production">
21+
An error has occurred. This application may no longer respond until reloaded.
22+
</environment>
23+
<environment include="Development">
24+
An unhandled exception has occurred. See browser dev tools for details.
25+
</environment>
26+
<a href="" class="reload">Reload</a>
27+
<a class="dismiss">🗙</a>
28+
</div>
29+
30+
<script src="_framework/blazor.server.js"></script>
31+
</body>
32+
</html>

KB-Samples/QRCodeMargin/Program.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using Microsoft.AspNetCore.Components;
2+
using Microsoft.AspNetCore.Components.Web;
3+
using Syncfusion.Blazor;
4+
5+
var builder = WebApplication.CreateBuilder(args);
6+
builder.Services.AddRazorPages();
7+
builder.Services.AddServerSideBlazor();
8+
builder.Services.AddSyncfusionBlazor();
9+
var app = builder.Build();
10+
11+
if (!app.Environment.IsDevelopment())
12+
{
13+
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
14+
app.UseHsts();
15+
}
16+
17+
app.UseHttpsRedirection();
18+
19+
app.UseStaticFiles();
20+
21+
app.UseRouting();
22+
23+
app.MapBlazorHub();
24+
app.MapFallbackToPage("/_Host");
25+
26+
app.Run();
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"iisSettings": {
3+
"iisExpress": {
4+
"applicationUrl": "http://localhost:32445",
5+
"sslPort": 44313
6+
}
7+
},
8+
"profiles": {
9+
"http": {
10+
"commandName": "Project",
11+
"dotnetRunMessages": true,
12+
"launchBrowser": true,
13+
"applicationUrl": "http://localhost:5098",
14+
"environmentVariables": {
15+
"ASPNETCORE_ENVIRONMENT": "Development"
16+
}
17+
},
18+
"https": {
19+
"commandName": "Project",
20+
"dotnetRunMessages": true,
21+
"launchBrowser": true,
22+
"applicationUrl": "https://localhost:7081;http://localhost:5098",
23+
"environmentVariables": {
24+
"ASPNETCORE_ENVIRONMENT": "Development"
25+
}
26+
},
27+
"IIS Express": {
28+
"commandName": "IISExpress",
29+
"launchBrowser": true,
30+
"environmentVariables": {
31+
"ASPNETCORE_ENVIRONMENT": "Development"
32+
}
33+
}
34+
}
35+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project Sdk="Microsoft.NET.Sdk.Web">
3+
<PropertyGroup>
4+
<TargetFramework>net6.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
</PropertyGroup>
8+
<ItemGroup>
9+
<PackageReference Include="Syncfusion.Blazor" Version="*" />
10+
<PackageReference Include="Syncfusion.Blazor.Themes" Version="*" />
11+
</ItemGroup>
12+
</Project>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project Sdk="Microsoft.NET.Sdk.Web">
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
</PropertyGroup>
8+
<ItemGroup>
9+
<PackageReference Include="Syncfusion.Blazor" Version="*" />
10+
<PackageReference Include="Syncfusion.Blazor.Themes" Version="*" />
11+
</ItemGroup>
12+
</Project>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@using Microsoft.AspNetCore.Components.Routing
2+
@using Microsoft.AspNetCore.Components.Web
3+
@using Microsoft.JSInterop
4+
@using QRCodeMargin
5+
@using Syncfusion.Blazor.Diagram
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"DetailedErrors": true,
3+
"Logging": {
4+
"LogLevel": {
5+
"Default": "Information",
6+
"Microsoft.AspNetCore": "Warning"
7+
}
8+
}
9+
}

0 commit comments

Comments
 (0)