[]
The following quick start guide is intended to get you up and running with the Windows control. In this quick start, you'll start with creating a new application, add the Windows control to it, add header and content to it.
type=note
Note: Blazor Server App or server-side app can be created using the Blazor Server App template. For more details, see Blazor Server topic under Blazor Project Types.
In the Solution Explorer, right click Dependencies and select Manage NuGet Packages.
In NuGet Package Manager, select nuget.org as the Package source.
Search for C1.Blazor.Input package and click Install.
Navigate to the wwwroot, open index.html file.
Register the client resources by adding the following lines of code to the <head> tag.
<link rel="stylesheet" href="/_content/C1.Blazor.Core/styles.css" />
<link rel="stylesheet" href="/_content/C1.Blazor.Input/styles.css" />
Add the following code to the <body> tag.
<script src="/_content/C1.Blazor.Core/scripts.js"></script>
<script src="/_content/C1.Blazor.Input/scripts.js"></script>
Right click on Pages folder, click Add | Razor Component to add a new Razor page and then provide a name, say WindowQuickStart.
Add the required directives to initialize and use the Window control in the new Razor page.
@using C1.Blazor.Input
Display a popup window with header and content using the following code:
<button class="btn btn-default" @onclick="@OpenPopup" style="border-color:gray">Open C1Window</button>
<C1Window @ref="myPopup" Style="@("width: 400px")">
<PopupHeader>Window Popup Header</PopupHeader>
<PopupContent>Hello. This is the Windows control.</PopupContent>
</C1Window>
@code{
C1Window myPopup;
void OpenPopup()
{
myPopup.Open();
}
void ClosePopup()
{
myPopup.Close();
}
}