|
@page "/"
@using Syncfusion.Blazor.Buttons
@using Syncfusion.Blazor.Popups
<SfTooltip @ref="TooltipInstance" ID="tooltip" IsSticky="true" Target="#target" Content="@TooltipContent" OnOpen="onTooltipOpen">
<div id='container'>
<p>
A green home is a type of house designed to be
<a id="target">
<u>environmentally friendly</u>
</a> and sustainable. And also focuses on the efficient use of "energy, water, and building materials." As green homes
have become more prevalent we have also seen the emergence of green affordable housing.
</p>
</div>
</SfTooltip>
<SfButton @ref="ToggleBtn" @onclick="onToggleClick" CssClass="e-flat" IsPrimary="true" Content="@Content"></SfButton>
@code {
SfButton ToggleBtn;
SfTooltip TooltipInstance;
public string Content = "Delete_Content";
string TooltipContent = "<div><b>Environmentally friendly</b> or environment-friendly, (also referred to as eco-friendly, nature-friendly, and green) are marketing and sustainability terms referring to goods and services, laws, guidelines and policies that inflict reduced, minimal, or no harm upon ecosystems or the environment.</div>";
private void onToggleClick(Microsoft.AspNetCore.Components.Web.MouseEventArgs args)
{
this.TooltipContent = String.Empty;
this.StateHasChanged();
}
private void onTooltipOpen(TooltipEventArgs args)
{
if (this.TooltipContent == "")
{
args.Cancel = true;
}
}
} |