All Projects → jsakamoto → FindRazorSourceFile

jsakamoto / FindRazorSourceFile

Licence: MPL-2.0 license
This is a set of NuGet packages that makes your Blazor apps display the source .razor file name that generated the HTML element under the mouse cursor when entering the Ctrl + Shift + F hotkeys.

Programming Languages

C#
18002 projects
HTML
75241 projects
typescript
32286 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to FindRazorSourceFile

AutoSaveEditForm
A replacement for the default EditForm component which will auto save a form until it is successfully submitted
Stars: ✭ 44 (+12.82%)
Mutual labels:  blazor, blazor-server, blazor-webassembly
MudBlazor
Blazor Component Library based on Material design with an emphasis on ease of use. Mainly written in C# with Javascript kept to a bare minimum it empowers .NET developers to easily debug it if needed.
Stars: ✭ 4,539 (+11538.46%)
Mutual labels:  blazor, blazor-server, blazor-webassembly
blazor-ui
A collection of examples related to Telerik UI for Blazor Components: https://www.telerik.com/blazor-ui
Stars: ✭ 182 (+366.67%)
Mutual labels:  blazor, blazor-server, blazor-webassembly
Ant Design Blazor
🌈A set of enterprise-class UI components based on Ant Design and Blazor WebAssembly.
Stars: ✭ 3,890 (+9874.36%)
Mutual labels:  blazor, blazor-server, blazor-webassembly
smart-blazor
Blazor UI Components & Examples
Stars: ✭ 32 (-17.95%)
Mutual labels:  blazor, blazor-server, blazor-webassembly
AsteroidsWasm
Collection of applications based on a single C# .NET Standard project running in: Blazor Client (WebAssembly), Blazor Server, Electron, WPF, WinForms, Xamarin
Stars: ✭ 136 (+248.72%)
Mutual labels:  blazor, blazor-server, blazor-webassembly
Blazor.PersianDatePicker
A free JavaScript Jalali (Persian) and Gregorian (Miladi) dual datepicker library for Blazor applications
Stars: ✭ 40 (+2.56%)
Mutual labels:  blazor, blazor-server, blazor-webassembly
Blazorade-Teams
A Blazor component library that is designed to be used when building applications for Microsoft Teams.
Stars: ✭ 29 (-25.64%)
Mutual labels:  blazor, blazor-server, blazor-webassembly
MudBlazor.Markdown
Markdown component based on the MudBlazor environment
Stars: ✭ 30 (-23.08%)
Mutual labels:  blazor, blazor-server, blazor-webassembly
blazor-tour-of-heroes
The Angular Tour of Heroes tutorial, but done using Blazor instead
Stars: ✭ 17 (-56.41%)
Mutual labels:  blazor, blazor-server
TextEditor
Rich text editor for Blazor applications - Uses Quill JS
Stars: ✭ 156 (+300%)
Mutual labels:  blazor, blazor-server
MASA.Blazor
Blazor component library based on Material Design. Support Blazor Server and Blazor WebAssembly.
Stars: ✭ 469 (+1102.56%)
Mutual labels:  blazor, blazor-server
BlazorServerWithDocker
Companion code sample for my blog post - Containerising a Blazor Server App
Stars: ✭ 16 (-58.97%)
Mutual labels:  blazor, blazor-server
blazor-tailwindcss-template
This template demostrates the integration of tailwindcss with blazor and covers important features like hot-reload and css isolation
Stars: ✭ 38 (-2.56%)
Mutual labels:  blazor, blazor-webassembly
Blazor.BrowserExtension
A package for building Browser Extension with Blazor WebAssembly application.
Stars: ✭ 207 (+430.77%)
Mutual labels:  blazor, blazor-webassembly
ASPCore.BlazorCrud
CRUD Using Blazor And Entity Framework Core
Stars: ✭ 39 (+0%)
Mutual labels:  blazor, blazor-webassembly
BlazorWasmWithDocker
Companion code sample for my blog post - Containerising a Blazor WebAssembly App
Stars: ✭ 16 (-58.97%)
Mutual labels:  blazor, blazor-webassembly
blazor-docs
Public Documentation for Telerik UI for Blazor components.
Stars: ✭ 42 (+7.69%)
Mutual labels:  blazor, blazor-server
BlazorSimpleSurvey
Blazor Simple Survey
Stars: ✭ 39 (+0%)
Mutual labels:  blazor, blazor-server
MvvmBlazor
A lightweight Blazor Mvvm Library
Stars: ✭ 203 (+420.51%)
Mutual labels:  blazor, blazor-server

FindRazorSourceFile

NuGet Package NuGet Package

What's this?

This package makes your Blazor apps display the source .razor file name that generated the HTML element under the mouse cursor when entering the Ctrl + Shift + F hotkeys.

movie

movie

1. Installation

1-a. for Blazor WebAssembly projects

  1. Add the FindRazorSource.WebAssembly NuGet package to your Blazor WebAssembly project.
> dotnet add package FindRazorSource.WebAssembly
  1. Add calling of the UseFindRazorSourceFile() extension method for WebAssemblyHostBuilder at the startup of your Blazor WebAssembly app.
// This is a "Program.cs" file of a Blazor Wasm app.
...
using FindRazorSourceFile.WebAssembly; // 👈 Open this namespace, and...
...
  public static async Task Main(string[] args)
  {
    var builder = WebAssemblyHostBuilder.CreateDefault(args);

    // 👇 Add this #if ~ #endif block.
#if DEBUG
    builder.UseFindRazorSourceFile();
#endif
    ...

1-b. for Blazor Server projects

  1. Add the FindRazorSource.Server NuGet package to your Blazor Server project.
> dotnet add package FindRazorSource.Server
  1. Add calling of the UseFindRazorSourceFile() extension method for IApplicationBuilder at the startup of your Blazor Server app.
// This is a "Startup.cs" file of a Blazor Server app.
...
using FindRazorSourceFile.Server; // 👈 Open this namespace, and...
...
  public void Configure(IApplicationBuilder app, ...)
  {
    if (env.IsDevelopment())
    {
      ...      
      app.UseFindRazorSourceFile(); // 👈 Add this line.
    }
    ...

1-c. for Blazor components library projects

What you have to do is just adding the FindRazorSource NuGet package to the library project.

> dotnet add package FindRazorSource

2. Usage

2-1. Entering the "Inspection Mode"

After installing FindReSource in your Blazor project, the Blazor app running in a web browser will respond to Ctrl + Shift + F keyboard shortcuts entering to "Inspection Mode".

When the app entered "Inspection Mode," the entire browser screen will dim.

In this state, when you moved the mouse cursor, the HTML element under the mouse cursor will be highlighted, and the tooltip that displayed the source .razor file name generated that HTML element will appear.

2-2. Entering the "Lock Mode"

When you click an HTML element during the "Inspection Mode", the application's state will enter the "Lock Mode".

During the "Lock Mode", hovering the mouse cursor over the other HTML elements will have no effects.

The highlighting of the HTML element and showing the tooltip will be maintained.

This mode will be helpful for you to selecting and copy to the clipboard the source .razor file name displayed on the tooltip.

2-3. Exit each mode

To escape from these modes, you can press the ESC key.

And also, the mouse click during the "Lock Mode" will exit that mode and return to "Inspection Mode".

3. Open in Visual Studio Code

Once you enable the "Open the .razor file of the clicked component in VSCode" option from the "Find Razor Source File" settings button, which is placed in the bottom-right corner of the page,

fig.3

the .razor file of you clicked component will be opened in a Visual Studio Code editor.

4. Open in Visual Studio IDE - the Visual Studio Extension for "FindRazorSourceFile"

If you are using Visual Studio IDE on Windows OS, please check out the Visual Studio Extension "Find Razor Source File - Browser Link Extension / VS2022 Extension" from the URL below.

If you have installed the extension above in your Visual Studio IDE and configured everything required to enable the "BrowserLink" feature of Visual Studio, entering "Lock Mode" causes opening the .razor file the source of clicked HTML element automatically in your Visual Studio!

3-1. Requirements

  • Visual Studio 2019 or 2022

  • "Find Razor Source File - Browser Link Extension / VS2022 Extension" works only on Blazor Server projects and ASP.NET Core hosted Blazor WebAssembly projects. Currently, the extension doesn't work on Blazor WebAssembly client-only projects yet.

3-2. Usage

To enable "Find Razor Source File - Browser Link Extension / VS2022 Extension", please follow the instruction below.

  1. Of course, the target project must have installed the "FindRazorSource" feature, and please confirm the "Inspection Mode" and "Lock Mode" works well on a web browser before.

  2. Check on the "Enable Browser Link" dropdown menu in the toolbar of your Visual Studio.

fig.1

If you are using Visual Studio 2019, you have to do an additional instruction below.

Additional instruction steps in VS2019
  1. Add the Microsoft.VisualStudio.Web.BrowserLink NuGet package to your Blazor Server or ASP.NET Core host project.
> dotnet add package Microsoft.VisualStudio.Web.BrowserLink
  1. Add calling of the UseBrowserLink() extension method for IApplicationBuilder at the startup of your Blazor Server app or ASP.NET Core host app.
// This is a "Startup.cs" file of a Server app.
  ...
  public void Configure(IApplicationBuilder app, ...)
  {
    if (env.IsDevelopment())
    {
      ...      
      app.UseBrowserLink(); // 👈 Add this line.
      ...
    }
    ...

IMPORTANT NOTICE: Please place the calling UseBrowserLink() before the calling UseFindRazorSourceFile() if the project is a Blazor Server.

After doing the all steps of the instruction above and launch the project, the .razor source file will be opened in the Visual Studio when the HTML element is clicked in the "Inspection Mode" on a web browser! 👍

License

Mozilla Public License Version 2.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].