Select theme:
Methods are the bread and butter of every Blazor application. You use them to query a database, respond to user actions, handle Blazor lifecycle events and more.
You can manage methods and their statements of your Blazor components or C# classes via Radzen Blazor Studio's Methods design mode.
To access Methods design mode open a .razor
or .cs
file and click the corresponding button in the design canvas toolbar.
Radzen Blazor Studio will display a dropdown with all methods that are accessible are accessible from the current class / component.
Radzen Blazor Studio lists methods that may be defined in other files (when you use partial classes for example).
Methods consist of statements - basically one or more lines of code that perform certain task. For example assignments, loops, if checks, try/catch blocks, method invocations et. al.
Radzen Blazor Studio allows you to visually edit a method by adding or removing statements to it.
Invoking a service method and assigning its result to a field is a common task in Blazor development. Here is how to do it with Radzen Blazor Studio.
.razor
file and enter Methods design mode.OnInitializedAsync
from the Override dropdown. It lists all Blazor lifecycle methods which are not yet overridden by your component.Radzen Blazor Studio provides built-in support for the following statements.
Assign values to existing fields, properties or variables.
Declare method variables to store method or computation results.
Create C# if
statements.
Create C# switch
statements.
Create C# for
loops.
Create C# foreach
loops.
Create C# do/while
loops.
Create C# while
loops.
Invoke own methods or methods of properties or fields.
Use the NavigationManager
to navigate to a page. A page is a Blazor component with a @page
directive.
Return to the previous page.
Create a try/catch
block.
Create a C# using
statement.
Display a notification message. Uses the Radzen.Blazor library's NotificationService
.
Display a dialog. Uses the Radzen.Blazor library's DialogService
.
Closes the current dialog. Uses the Radzen.Blazor library's DialogService
.
Opens a context menu. Uses the Radzen.Blazor library's ContextMenuService
.
Opens a tooltip. Uses the Radzen.Blazor library's TooltipService
.
Any other C# statement.
Important: statements that require the
Radzen.Blazor
component library are available only in applications that have Radzen.Blazor correctly installed and the required services registered.
Radzen is free to use. You can also test the premium features for 15 days.
Download NowSelect theme: