-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from Backiaraj/spinner
Update the project
- Loading branch information
Showing
43 changed files
with
1,644 additions
and
1,358 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
<Router AppAssembly="@typeof(App).Assembly"> | ||
<Found Context="routeData"> | ||
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" /> | ||
<FocusOnNavigate RouteData="@routeData" Selector="h1" /> | ||
</Found> | ||
<NotFound> | ||
<PageTitle>Not found</PageTitle> | ||
<LayoutView Layout="@typeof(MainLayout)"> | ||
<p role="alert">Sorry, there's nothing at this address.</p> | ||
</LayoutView> | ||
</NotFound> | ||
</Router> | ||
<Router AppAssembly="@typeof(App).Assembly"> | ||
<Found Context="routeData"> | ||
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" /> | ||
<FocusOnNavigate RouteData="@routeData" Selector="h1" /> | ||
</Found> | ||
<NotFound> | ||
<PageTitle>Not found</PageTitle> | ||
<LayoutView Layout="@typeof(MainLayout)"> | ||
<p role="alert">Sorry, there's nothing at this address.</p> | ||
</LayoutView> | ||
</NotFound> | ||
</Router> |
37 changes: 21 additions & 16 deletions
37
MyBlazorProject.csproj → Client/GettingStarted.Client.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,21 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.2" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.2" PrivateAssets="all" /> | ||
<PackageReference Include="Syncfusion.Blazor.Navigations" Version="19.4.0.55" /> | ||
<PackageReference Include="Syncfusion.Blazor.Spinner" Version="19.4.0.55" /> | ||
</ItemGroup> | ||
|
||
</Project> | ||
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.2" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.2" PrivateAssets="all" /> | ||
<PackageReference Include="Syncfusion.Blazor.Navigations" Version="23.1.43" /> | ||
<PackageReference Include="Syncfusion.Blazor.Spinner" Version="23.1.43" /> | ||
<PackageReference Include="Syncfusion.Blazor.Themes" Version="23.1.43" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Shared\GettingStarted.Shared.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
@page "/counter" | ||
|
||
<PageTitle>Counter</PageTitle> | ||
|
||
<h1>Counter</h1> | ||
|
||
<p role="status">Current count: @currentCount</p> | ||
|
||
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button> | ||
|
||
@code { | ||
private int currentCount = 0; | ||
|
||
private void IncrementCount() | ||
{ | ||
currentCount++; | ||
} | ||
} | ||
@page "/counter" | ||
|
||
<PageTitle>Counter</PageTitle> | ||
|
||
<h1>Counter</h1> | ||
|
||
<p role="status">Current count: @currentCount</p> | ||
|
||
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button> | ||
|
||
@code { | ||
private int currentCount = 0; | ||
|
||
private void IncrementCount() | ||
{ | ||
currentCount++; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,47 @@ | ||
@page "/fetchdata" | ||
@inject HttpClient Http | ||
|
||
<PageTitle>Weather forecast</PageTitle> | ||
|
||
<h1>Weather forecast</h1> | ||
|
||
<p>This component demonstrates fetching data from the server.</p> | ||
|
||
@if (forecasts == null) | ||
{ | ||
<p><em>Loading...</em></p> | ||
} | ||
else | ||
{ | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th>Date</th> | ||
<th>Temp. (C)</th> | ||
<th>Temp. (F)</th> | ||
<th>Summary</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
@foreach (var forecast in forecasts) | ||
{ | ||
<tr> | ||
<td>@forecast.Date.ToShortDateString()</td> | ||
<td>@forecast.TemperatureC</td> | ||
<td>@forecast.TemperatureF</td> | ||
<td>@forecast.Summary</td> | ||
</tr> | ||
} | ||
</tbody> | ||
</table> | ||
} | ||
|
||
@code { | ||
private WeatherForecast[]? forecasts; | ||
|
||
protected override async Task OnInitializedAsync() | ||
{ | ||
forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>("sample-data/weather.json"); | ||
} | ||
|
||
public class WeatherForecast | ||
{ | ||
public DateTime Date { get; set; } | ||
|
||
public int TemperatureC { get; set; } | ||
|
||
public string? Summary { get; set; } | ||
|
||
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); | ||
} | ||
} | ||
@page "/fetchdata" | ||
@using GettingStarted.Shared | ||
@inject HttpClient Http | ||
|
||
<PageTitle>Weather forecast</PageTitle> | ||
|
||
<h1>Weather forecast</h1> | ||
|
||
<p>This component demonstrates fetching data from the server.</p> | ||
|
||
@if (forecasts == null) | ||
{ | ||
<p><em>Loading...</em></p> | ||
} | ||
else | ||
{ | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th>Date</th> | ||
<th>Temp. (C)</th> | ||
<th>Temp. (F)</th> | ||
<th>Summary</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
@foreach (var forecast in forecasts) | ||
{ | ||
<tr> | ||
<td>@forecast.Date.ToShortDateString()</td> | ||
<td>@forecast.TemperatureC</td> | ||
<td>@forecast.TemperatureF</td> | ||
<td>@forecast.Summary</td> | ||
</tr> | ||
} | ||
</tbody> | ||
</table> | ||
} | ||
|
||
@code { | ||
private WeatherForecast[]? forecasts; | ||
|
||
protected override async Task OnInitializedAsync() | ||
{ | ||
forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>("WeatherForecast"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,75 @@ | ||
@page "/" | ||
@using Syncfusion.Blazor.Navigations; | ||
|
||
<div class="row"> | ||
<div id="container"> | ||
<SfSpinner Visible="true" Label="Bootstrap5" Size="60" | ||
CssClass="e-custom-color"></SfSpinner> | ||
</div> | ||
|
||
<div id="container2"> | ||
<SfSpinner Visible="true" Type="SpinnerType.Bootstrap" Label="Bootstrap" | ||
CssClass="e-spin-overlay"></SfSpinner> | ||
</div> | ||
</div> | ||
|
||
<SfTab> | ||
<TabItems> | ||
<TabItem Content="Twitter is an online social networking service that enables users to send and read short 140-character messages called tweets. Registered users can read and post tweets, but those who are unregistered can only read them. Users access Twitter through the website interface, SMS or mobile device app Twitter Inc. is based in SanFrancisco and has more than 25 offices around the world. Twitter was created in March 2006 by Jack Dorsey, Evan Williams, Biz Stone, and Noah Glass and launched in July 2006. The service rapidly gained worldwide popularity, with more than 100 million users posting 340 million tweets a day in 2012. The service also handled 1.6 billionsearch queries per day."> | ||
<ChildContent> | ||
<TabHeader Text="Twitter"></TabHeader> | ||
</ChildContent> | ||
</TabItem> | ||
<TabItem Content=" Facebook is an online social networking service headquartered in Menlo Park, California. Its website was launched on February 4, 2004, by Mark Zuckerberg with his Harvard College roommates and fellow students EduardoSaverin, Andrew McCollum, Dustin Moskovitz and Chris Hughes. The founders had initially limited the website membership to Harvard students, but later expanded it to colleges in the Boston area, the Ivy League, and Stanford University. It gradually added support for students at various other universities and later to high-school students."> | ||
<ChildContent> | ||
<TabHeader Text="Facebook"></TabHeader> | ||
</ChildContent> | ||
</TabItem> | ||
<TabItem Content="WhatsApp Messenger is a proprietary cross-platform instant messaging client for smartphones that operates under a subscription business model. It uses the Internet to send text messages, images, video, user location andaudio media messages to other users using standard cellular mobile numbers. As of February 2016, WhatsApp had a userbase of up to one billion,[10] making it the most globally popular messaging application WhatsApp Inc., based inMountain View, California, was acquired by Facebook Inc. on February 19, 2014, for approximately US $19.3 billion."> | ||
<ChildContent> | ||
<TabHeader Text="WhatsApp"></TabHeader> | ||
</ChildContent> | ||
</TabItem> | ||
</TabItems> | ||
<TabEvents Selecting="ShowSpinner" Selected="HideSpinner"></TabEvents> | ||
@*Add @ref="SpinnerObj" to access built-in methods of Spinner component*@ | ||
<SfSpinner @bind-Visible="VisibleProperty"></SfSpinner> | ||
</SfTab> | ||
|
||
|
||
@code{ | ||
//SfSpinner SpinnerObj; | ||
public bool VisibleProperty { get; set; } = false; | ||
|
||
public void ShowSpinner() | ||
{ | ||
this.VisibleProperty = true; | ||
//this.SpinnerObj.ShowAsync(); | ||
} | ||
|
||
public async Task HideSpinner() | ||
{ | ||
await Task.Delay(2000); | ||
this.VisibleProperty = false; | ||
//this.SpinnerObj.HideAsync(); | ||
} | ||
} | ||
|
||
<style> | ||
.row{ | ||
display: flex; | ||
margin: 5%; | ||
} | ||
#container, #container2{ | ||
height:120px; | ||
width: 120px; | ||
position: relative; | ||
} | ||
.e-spinner-pane.e-custom-color .e-spinner-inner .e-spin-bootstrap5{ | ||
stroke: green; | ||
} | ||
</style> | ||
|
||
|
||
|
||
@page "/" | ||
|
||
<div class="row"> | ||
<div id="container"> | ||
<SfSpinner Visible="true" Label="Bootstrap5" Size="60" | ||
CssClass="e-custom-color"></SfSpinner> | ||
</div> | ||
|
||
<div id="container2"> | ||
<SfSpinner Visible="true" Type="SpinnerType.Bootstrap" Label="Bootstrap" | ||
CssClass="e-spin-overlay"></SfSpinner> | ||
</div> | ||
</div> | ||
|
||
<SfTab> | ||
<TabItems> | ||
<TabItem Content="Twitter is an online social networking service that enables users to send and read short 140-character messages called tweets. Registered users can read and post tweets, but those who are unregistered can only read them. Users access Twitter through the website interface, SMS or mobile device app Twitter Inc. is based in SanFrancisco and has more than 25 offices around the world. Twitter was created in March 2006 by Jack Dorsey, Evan Williams, Biz Stone, and Noah Glass and launched in July 2006. The service rapidly gained worldwide popularity, with more than 100 million users posting 340 million tweets a day in 2012. The service also handled 1.6 billionsearch queries per day."> | ||
<ChildContent> | ||
<TabHeader Text="Twitter"></TabHeader> | ||
</ChildContent> | ||
</TabItem> | ||
<TabItem Content=" Facebook is an online social networking service headquartered in Menlo Park, California. Its website was launched on February 4, 2004, by Mark Zuckerberg with his Harvard College roommates and fellow students EduardoSaverin, Andrew McCollum, Dustin Moskovitz and Chris Hughes. The founders had initially limited the website membership to Harvard students, but later expanded it to colleges in the Boston area, the Ivy League, and Stanford University. It gradually added support for students at various other universities and later to high-school students."> | ||
<ChildContent> | ||
<TabHeader Text="Facebook"></TabHeader> | ||
</ChildContent> | ||
</TabItem> | ||
<TabItem Content="WhatsApp Messenger is a proprietary cross-platform instant messaging client for smartphones that operates under a subscription business model. It uses the Internet to send text messages, images, video, user location andaudio media messages to other users using standard cellular mobile numbers. As of February 2016, WhatsApp had a userbase of up to one billion,[10] making it the most globally popular messaging application WhatsApp Inc., based inMountain View, California, was acquired by Facebook Inc. on February 19, 2014, for approximately US $19.3 billion."> | ||
<ChildContent> | ||
<TabHeader Text="WhatsApp"></TabHeader> | ||
</ChildContent> | ||
</TabItem> | ||
</TabItems> | ||
<TabEvents Selecting="ShowSpinner" Selected="HideSpinner"></TabEvents> | ||
@*Add @ref="SpinnerObj" to access built-in methods of Spinner component*@ | ||
<SfSpinner @bind-Visible="VisibleProperty"></SfSpinner> | ||
</SfTab> | ||
|
||
|
||
@code { | ||
//SfSpinner SpinnerObj; | ||
public bool VisibleProperty { get; set; } = false; | ||
|
||
public void ShowSpinner() | ||
{ | ||
this.VisibleProperty = true; | ||
//this.SpinnerObj.ShowAsync(); | ||
} | ||
|
||
public async Task HideSpinner() | ||
{ | ||
await Task.Delay(2000); | ||
this.VisibleProperty = false; | ||
//this.SpinnerObj.HideAsync(); | ||
} | ||
} | ||
|
||
<style> | ||
.row { | ||
display: flex; | ||
margin: 5%; | ||
} | ||
#container, #container2 { | ||
height: 120px; | ||
width: 120px; | ||
position: relative; | ||
} | ||
.e-spinner-pane.e-custom-color .e-spinner-inner .e-spin-bootstrap5 { | ||
stroke: green; | ||
} | ||
</style> | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
using Microsoft.AspNetCore.Components.Web; | ||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting; | ||
using MyBlazorProject; | ||
using Syncfusion.Blazor; | ||
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("NTkyMTQ5QDMxMzkyZTM0MmUzMEVXUE9pUll5VTdDZ1o4YXhuVWdLY2NuVlZXWnhmTnZJdzR1NEt3V1JaUEE9"); | ||
var builder = WebAssemblyHostBuilder.CreateDefault(args); | ||
builder.RootComponents.Add<App>("#app"); | ||
builder.RootComponents.Add<HeadOutlet>("head::after"); | ||
builder.Services.AddSyncfusionBlazor(options => { options.IgnoreScriptIsolation = true; }); | ||
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); | ||
|
||
await builder.Build().RunAsync(); | ||
using GettingStarted.Client; | ||
using Microsoft.AspNetCore.Components.Web; | ||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting; | ||
using Syncfusion.Blazor; | ||
|
||
var builder = WebAssemblyHostBuilder.CreateDefault(args); | ||
builder.RootComponents.Add<App>("#app"); | ||
builder.RootComponents.Add<HeadOutlet>("head::after"); | ||
|
||
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); | ||
builder.Services.AddSyncfusionBlazor(); | ||
await builder.Build().RunAsync(); |
Oops, something went wrong.