Skip to content

Commit d75fc01

Browse files
931755: Updated the Remove Zoom Option to latest sample.
1 parent 140ae3a commit d75fc01

Some content is hidden

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

46 files changed

+1233
-414
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>

Common/RemoveZoomOption/RemoveZoomOption/RemoveZoomOption.csproj renamed to Common/Remove Zoom Option/BlazorApp/BlazorApp.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Syncfusion.Blazor.PdfViewerServer.Windows" Version="*" />
10+
<PackageReference Include="Syncfusion.Blazor.SfPdfViewer" Version="*" />
1111
<PackageReference Include="Syncfusion.Blazor.Themes" Version="*" />
1212
</ItemGroup>
1313

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
1-
21
Microsoft Visual Studio Solution File, Format Version 12.00
32
# Visual Studio Version 17
4-
VisualStudioVersion = 17.8.34330.188
3+
VisualStudioVersion = 17.5.2.0
54
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RemoveZoomOption", "RemoveZoomOption\RemoveZoomOption.csproj", "{2EF6954E-AE1E-4685-851F-8DE3CD61A797}"
5+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorApp", "BlazorApp.csproj", "{27F76D72-2B50-69F5-F67F-C21252CFC197}"
76
EndProject
87
Global
98
GlobalSection(SolutionConfigurationPlatforms) = preSolution
109
Debug|Any CPU = Debug|Any CPU
1110
Release|Any CPU = Release|Any CPU
1211
EndGlobalSection
1312
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{2EF6954E-AE1E-4685-851F-8DE3CD61A797}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15-
{2EF6954E-AE1E-4685-851F-8DE3CD61A797}.Debug|Any CPU.Build.0 = Debug|Any CPU
16-
{2EF6954E-AE1E-4685-851F-8DE3CD61A797}.Release|Any CPU.ActiveCfg = Release|Any CPU
17-
{2EF6954E-AE1E-4685-851F-8DE3CD61A797}.Release|Any CPU.Build.0 = Release|Any CPU
13+
{27F76D72-2B50-69F5-F67F-C21252CFC197}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
14+
{27F76D72-2B50-69F5-F67F-C21252CFC197}.Debug|Any CPU.Build.0 = Debug|Any CPU
15+
{27F76D72-2B50-69F5-F67F-C21252CFC197}.Release|Any CPU.ActiveCfg = Release|Any CPU
16+
{27F76D72-2B50-69F5-F67F-C21252CFC197}.Release|Any CPU.Build.0 = Release|Any CPU
1817
EndGlobalSection
1918
GlobalSection(SolutionProperties) = preSolution
2019
HideSolutionNode = FALSE
2120
EndGlobalSection
2221
GlobalSection(ExtensibilityGlobals) = postSolution
23-
SolutionGuid = {59C17A7C-A21F-4E2B-8576-9020DD32706D}
22+
SolutionGuid = {E2DC76FF-FE7E-4C2D-B97E-074C7E7976BB}
2423
EndGlobalSection
2524
EndGlobal
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
namespace BlazorApp.Data;
2+
3+
public class WeatherForecast
4+
{
5+
public DateOnly Date { get; set; }
6+
7+
public int TemperatureC { get; set; }
8+
9+
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
10+
11+
public string? Summary { get; set; }
12+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
namespace BlazorApp.Data;
2+
3+
public class WeatherForecastService
4+
{
5+
private static readonly string[] Summaries = new[]
6+
{
7+
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
8+
};
9+
10+
public Task<WeatherForecast[]> GetForecastAsync(DateOnly startDate)
11+
{
12+
return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast
13+
{
14+
Date = startDate.AddDays(index),
15+
TemperatureC = Random.Shared.Next(-20, 55),
16+
Summary = Summaries[Random.Shared.Next(Summaries.Length)]
17+
}).ToArray());
18+
}
19+
}

Common/RemoveZoomOption/RemoveZoomOption/Components/Pages/Counter.razor renamed to Common/Remove Zoom Option/BlazorApp/Pages/Counter.razor

File renamed without changes.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
@page
2+
@model BlazorApp.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: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System.Diagnostics;
2+
using Microsoft.AspNetCore.Mvc;
3+
using Microsoft.AspNetCore.Mvc.RazorPages;
4+
5+
namespace BlazorApp.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+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
@page "/fetchdata"
2+
@using BlazorApp.Data
3+
@inject WeatherForecastService ForecastService
4+
5+
<PageTitle>Weather forecast</PageTitle>
6+
7+
<h1>Weather forecast</h1>
8+
9+
<p>This component demonstrates fetching data from a service.</p>
10+
11+
@if (forecasts == null)
12+
{
13+
<p><em>Loading...</em></p>
14+
}
15+
else
16+
{
17+
<table class="table">
18+
<thead>
19+
<tr>
20+
<th>Date</th>
21+
<th>Temp. (C)</th>
22+
<th>Temp. (F)</th>
23+
<th>Summary</th>
24+
</tr>
25+
</thead>
26+
<tbody>
27+
@foreach (var forecast in forecasts)
28+
{
29+
<tr>
30+
<td>@forecast.Date.ToShortDateString()</td>
31+
<td>@forecast.TemperatureC</td>
32+
<td>@forecast.TemperatureF</td>
33+
<td>@forecast.Summary</td>
34+
</tr>
35+
}
36+
</tbody>
37+
</table>
38+
}
39+
40+
@code {
41+
private WeatherForecast[]? forecasts;
42+
43+
protected override async Task OnInitializedAsync()
44+
{
45+
forecasts = await ForecastService.GetForecastAsync(DateOnly.FromDateTime(DateTime.Now));
46+
}
47+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
@page "/"
2+
@using Syncfusion.Blazor.SfPdfViewer
3+
<SfPdfViewer2 DocumentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"
4+
Height="100%"
5+
Width="100%">
6+
<PdfViewerToolbarSettings ToolbarItems="@ToolbarItems"></PdfViewerToolbarSettings>
7+
</SfPdfViewer2>
8+
9+
@code {
10+
private string DocumentPath { get; set; } = "wwwroot/Data/SinglePage.pdf";
11+
12+
List<ToolbarItem> ToolbarItems = new List<ToolbarItem>()
13+
{
14+
ToolbarItem.OpenOption,
15+
ToolbarItem.PageNavigationTool,
16+
ToolbarItem.SelectionTool,
17+
ToolbarItem.PanTool,
18+
ToolbarItem.UndoRedoTool,
19+
ToolbarItem.CommentTool,
20+
ToolbarItem.SubmitForm,
21+
ToolbarItem.SearchOption,
22+
ToolbarItem.AnnotationEditTool,
23+
ToolbarItem.PrintOption,
24+
ToolbarItem.DownloadOption,
25+
};
26+
}

0 commit comments

Comments
 (0)