Skip to content

Commit ce96477

Browse files
Merge pull request #11 from SF3888-Vigneshwaran/main
samples(BLAZ-25684): FAB, Speed dial, Skeleton samples added.
2 parents 46cd332 + a1099e1 commit ce96477

File tree

184 files changed

+7796
-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.

184 files changed

+7796
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Router AppAssembly="@typeof(App).Assembly">
2+
<Found Context="routeData">
3+
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
4+
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
5+
</Found>
6+
<NotFound>
7+
<PageTitle>Not found</PageTitle>
8+
<LayoutView Layout="@typeof(MainLayout)">
9+
<p role="alert">Sorry, there's nothing at this address.</p>
10+
</LayoutView>
11+
</NotFound>
12+
</Router>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net6.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Syncfusion.Blazor.Buttons" Version="20.3.0.48" />
11+
<PackageReference Include="Syncfusion.Blazor.Themes" Version="20.3.0.48" />
12+
</ItemGroup>
13+
14+
</Project>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.1.32319.34
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FABSamples", "FABSamples.csproj", "{F0C73036-367D-4BAE-B01B-000ACAE42787}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{F0C73036-367D-4BAE-B01B-000ACAE42787}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{F0C73036-367D-4BAE-B01B-000ACAE42787}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{F0C73036-367D-4BAE-B01B-000ACAE42787}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{F0C73036-367D-4BAE-B01B-000ACAE42787}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {4AA4630A-EED2-40B5-9C46-24F8B8BBB702}
24+
EndGlobalSection
25+
EndGlobal
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@page "/event-click"
2+
3+
@*Floating Action Button sample with 'Target' to position a FAB based on the target.*@
4+
5+
<div id="target" style="min-height:200px; position:relative; width:300px; border:1px solid;">
6+
<SfFab Target="#target" IconCss="e-icons e-plus" OnClick="EventClick"></SfFab>
7+
</div>
8+
9+
10+
@*Floating Action Button sample without 'Target' to position a FAB based on the target.*@
11+
12+
<SfFab IconCss="e-icons e-plus" OnClick="EventClick"></SfFab>
13+
14+
<label>Event log</label>
15+
<div style="border:1px solid;min-height:20px;"> @((MarkupString)log)</div>
16+
@code{
17+
private string log = "";
18+
public void EventClick()
19+
{
20+
// Here, you can call your desired action.
21+
log = log + "Fab Clicked.<br/>";
22+
}
23+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@page "/"
2+
3+
@*Floating Action Button sample with 'Target' to position a FAB based on the target.*@
4+
5+
<div id="target" style="min-height:200px; position:relative; width:300px; border:1px solid;">
6+
<SfFab Target="#target" Content="Add"></SfFab>
7+
</div>
8+
9+
10+
@*Floating Action Button sample without 'Target' to position a FAB based on the target.*@
11+
12+
<SfFab Content="Add"></SfFab>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
@page
2+
@model FABSamples.Pages.ErrorModel
3+
4+
<!DOCTYPE html>
5+
<html lang="en">
6+
7+
<head>
8+
<meta charset="utf-8" />
9+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
10+
<title>Error</title>
11+
<link href="~/css/bootstrap/bootstrap.min.css" rel="stylesheet" />
12+
<link href="~/css/site.css" rel="stylesheet" asp-append-version="true" />
13+
</head>
14+
15+
<body>
16+
<div class="main">
17+
<div class="content px-4">
18+
<h1 class="text-danger">Error.</h1>
19+
<h2 class="text-danger">An error occurred while processing your request.</h2>
20+
21+
@if (Model.ShowRequestId)
22+
{
23+
<p>
24+
<strong>Request ID:</strong> <code>@Model.RequestId</code>
25+
</p>
26+
}
27+
28+
<h3>Development Mode</h3>
29+
<p>
30+
Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred.
31+
</p>
32+
<p>
33+
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
34+
It can result in displaying sensitive information from exceptions to end users.
35+
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
36+
and restarting the app.
37+
</p>
38+
</div>
39+
</div>
40+
</body>
41+
42+
</html>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using Microsoft.AspNetCore.Mvc;
2+
using Microsoft.AspNetCore.Mvc.RazorPages;
3+
using System.Diagnostics;
4+
5+
namespace FABSamples.Pages
6+
{
7+
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
8+
[IgnoreAntiforgeryToken]
9+
public class ErrorModel : PageModel
10+
{
11+
public string? RequestId { get; set; }
12+
13+
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
14+
15+
private readonly ILogger<ErrorModel> _logger;
16+
17+
public ErrorModel(ILogger<ErrorModel> logger)
18+
{
19+
_logger = logger;
20+
}
21+
22+
public void OnGet()
23+
{
24+
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
25+
}
26+
}
27+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@page "/"
2+
@namespace FABSamples.Pages
3+
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
4+
@{
5+
Layout = "_Layout";
6+
}
7+
8+
<component type="typeof(App)" render-mode="ServerPrerendered" />
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
@using Microsoft.AspNetCore.Components.Web
2+
@namespace FABSamples.Pages
3+
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
4+
5+
<!DOCTYPE html>
6+
<html lang="en">
7+
<head>
8+
<meta charset="utf-8" />
9+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
10+
<base href="~/" />
11+
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
12+
<link href="css/site.css" rel="stylesheet" />
13+
<link href="FABSamples.styles.css" rel="stylesheet" />
14+
<link href="_content/Syncfusion.Blazor.Themes/bootstrap5.css" rel="stylesheet" />
15+
<script src="_content/Syncfusion.Blazor.Core/scripts/syncfusion-blazor.min.js" type="text/javascript"></script>
16+
<component type="typeof(HeadOutlet)" render-mode="ServerPrerendered" />
17+
</head>
18+
<body>
19+
@RenderBody()
20+
21+
<div id="blazor-error-ui">
22+
<environment include="Staging,Production">
23+
An error has occurred. This application may no longer respond until reloaded.
24+
</environment>
25+
<environment include="Development">
26+
An unhandled exception has occurred. See browser dev tools for details.
27+
</environment>
28+
<a href="" class="reload">Reload</a>
29+
<a class="dismiss">🗙</a>
30+
</div>
31+
32+
<script src="_framework/blazor.server.js"></script>
33+
</body>
34+
</html>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using Microsoft.AspNetCore.Components;
2+
using Microsoft.AspNetCore.Components.Web;
3+
using Syncfusion.Blazor;
4+
5+
var builder = WebApplication.CreateBuilder(args);
6+
7+
// Add services to the container.
8+
builder.Services.AddRazorPages();
9+
builder.Services.AddServerSideBlazor();
10+
builder.Services.AddSyncfusionBlazor(options => { options.IgnoreScriptIsolation = true; });
11+
12+
var app = builder.Build();
13+
14+
// Configure the HTTP request pipeline.
15+
if (!app.Environment.IsDevelopment())
16+
{
17+
app.UseExceptionHandler("/Error");
18+
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
19+
app.UseHsts();
20+
}
21+
22+
app.UseHttpsRedirection();
23+
24+
app.UseStaticFiles();
25+
26+
app.UseRouting();
27+
28+
app.MapBlazorHub();
29+
app.MapFallbackToPage("/_Host");
30+
31+
app.Run();

0 commit comments

Comments
 (0)