Popular blog tags

https://www.webassemblyman.com/blazor/blazorcomponents.html

Inline Component

 

Code Behind Component

 

Class Only Component

E:\..\Pages\Chat\chatindex.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Microsoft.AspNetCore.Components;


namespace Stockso.RazorComponent.Pages.Chat
{
    public class chatindex : ComponentBase
    {

        public string BlazorRocksText { get; set; } =
           "Blazor rocks the browser!";


        // flag to indicate chat status
        public bool chatting { get; set; } = false;

    }
}

 

E:\..\Pages\Chat\Index.razor

@using Stockso.RazorComponent.Pages.Chat

@page "/chat"

@inherits chatindex
<h1>@BlazorRocksText</h1>


@if (chatting)
{
    <div class="top-row px-4">
      
    </div>
}

 

Blazor Component Library