Skip to content

Commit b254152

Browse files
authored
Remove markup string (#2066)
* Remove MarkupString usage from the demos. * Remove MarkupString from RadzenPanelMenu. * Remove MarkupString from RadzenAccordion. * Remove MarkupString from RadzenIcon * Remove MarkupString from RadzenSplitButton * Remove MarkupString from RadzenButton * Add spaces in the keyboard navigation grid. * Remove MarkupString from RadzenDialog * Use literal strings for the icons in the Index page. * Remove MarkupString from RadzenSelectbar * Remove MarkupString from RadzenFieldset * Remove MarkupString from everything else.
1 parent a2d7964 commit b254152

40 files changed

+388
-355
lines changed

Radzen.Blazor/DialogService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ public void Dispose()
470470
var i = 0;
471471
b.OpenElement(i++, "p");
472472
b.AddAttribute(i++, "class", "rz-dialog-confirm-message");
473-
b.AddContent(i++, (MarkupString)message);
473+
b.AddContent(i++, message);
474474
b.CloseElement();
475475

476476
b.OpenElement(i++, "div");
@@ -518,7 +518,7 @@ public void Dispose()
518518
var i = 0;
519519
b.OpenElement(i++, "p");
520520
b.AddAttribute(i++, "class", "rz-dialog-alert-message");
521-
b.AddContent(i++, (MarkupString)message);
521+
b.AddContent(i++, message);
522522
b.CloseElement();
523523

524524
b.OpenElement(i++, "div");

Radzen.Blazor/RadzenAccordion.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@
3232
}
3333
@if (!string.IsNullOrEmpty(item.Icon))
3434
{
35-
<i class="notranslate rzi" style="@(!string.IsNullOrEmpty(item.IconColor) ? $"color:{item.IconColor}" : null)">@((MarkupString)item.Icon)</i>
35+
<i class="notranslate rzi" style="@(!string.IsNullOrEmpty(item.IconColor) ? $"color:{item.IconColor}" : null)">@item.Icon</i>
3636
}
3737
@if (item.Template != null)
3838
{
3939
@item.Template
4040
}
4141
else if(!string.IsNullOrEmpty(item.Text))
4242
{
43-
<span>@((MarkupString)item.Text)</span>
43+
<span>@item.Text</span>
4444
}
4545
</a>
4646
</div>

Radzen.Blazor/RadzenButton.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
{
2626
@if (!string.IsNullOrEmpty(@Icon))
2727
{
28-
<i class="notranslate rz-button-icon-left rzi" style="@(!string.IsNullOrEmpty(IconColor) ? $"color:{IconColor}" : null)">@((MarkupString)Icon)</i>
28+
<i class="notranslate rz-button-icon-left rzi" style="@(!string.IsNullOrEmpty(IconColor) ? $"color:{IconColor}" : null)">@Icon</i>
2929
}
3030
@if (!string.IsNullOrEmpty(Image))
3131
{

Radzen.Blazor/RadzenCheckBoxList.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
}
4343
else
4444
{
45-
<label class="rz-chkbox-label" aria-hidden="true">@((MarkupString)item.Text)</label>
45+
<label class="rz-chkbox-label" aria-hidden="true">@item.Text</label>
4646
}
4747
</div>
4848
}

Radzen.Blazor/RadzenDialog.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
@if (sideDialogOptions.ShowTitle)
2020
{
2121
<div class="rz-dialog-side-titlebar">
22-
<div class="rz-dialog-side-title" style="display: inline" id="rz-dialog-side-label">@((MarkupString)sideDialogOptions.Title)</div>
22+
<div class="rz-dialog-side-title" style="display: inline" id="rz-dialog-side-label">@sideDialogOptions.Title</div>
2323
@if (sideDialogOptions.ShowClose)
2424
{
2525
<a id="@(sideDialogOptions.GetHashCode() + "cl")" aria-label="@CloseSideDialogAriaLabel" @onclick:preventDefault="true" class="rz-dialog-side-titlebar-close" @onclick="@(_ => Service.CloseSide(null))" role="button" tabindex="@sideDialogOptions.CloseTabIndex">

Radzen.Blazor/RadzenFieldset.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
@if (!string.IsNullOrEmpty(Icon))
2525
{
26-
<i class="notranslate rzi" style="@(!string.IsNullOrEmpty(IconColor) ? $"color:{IconColor}" : null)">@((MarkupString)Icon)</i><span>@Text</span>
26+
<i class="notranslate rzi" style="@(!string.IsNullOrEmpty(IconColor) ? $"color:{IconColor}" : null)">@Icon</i><span>@Text</span>
2727
}
2828
else
2929
{
@@ -36,7 +36,7 @@
3636
{
3737
@if (!string.IsNullOrEmpty(Icon))
3838
{
39-
<i class="notranslate rzi" style="@(!string.IsNullOrEmpty(IconColor) ? $"color:{IconColor}" : null)">@((MarkupString)Icon)</i><span>@Text</span>
39+
<i class="notranslate rzi" style="@(!string.IsNullOrEmpty(IconColor) ? $"color:{IconColor}" : null)">@Icon</i><span>@Text</span>
4040
}
4141
else
4242
{

Radzen.Blazor/RadzenFormField.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</div>
1414
}
1515
@ChildContent
16-
<label class="rz-form-field-label rz-text-truncate" for=@Component>@((MarkupString)Text)</label>
16+
<label class="rz-form-field-label rz-text-truncate" for=@Component>@Text</label>
1717
@if (End != null)
1818
{
1919
<div class="rz-form-field-end">

Radzen.Blazor/RadzenIcon.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
@if (Visible)
44
{
5-
<i @ref="@Element" style="@getStyle()" @attributes="Attributes" class="@GetCssClass()" id="@GetId()">@((MarkupString)Icon)</i>
6-
}
5+
<i @ref="@Element" style="@getStyle()" @attributes="Attributes" class="@GetCssClass()" id="@GetId()">@Icon</i>
6+
}

Radzen.Blazor/RadzenLink.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<NavLink style="@Style" href="@GetPath()" @attributes="Attributes" class="@GetCssClass()" target="@GetTarget()" id="@GetId()" Match="@Match" >
66
@if (!string.IsNullOrEmpty(Icon))
77
{
8-
<i class="notranslate rzi" style="@(!string.IsNullOrEmpty(IconColor) ? $"color:{IconColor}" : null)">@((MarkupString)Icon)</i>
8+
<i class="notranslate rzi" style="@(!string.IsNullOrEmpty(IconColor) ? $"color:{IconColor}" : null)">@Icon</i>
99
}
1010
@if (!string.IsNullOrEmpty(Image))
1111
{

Radzen.Blazor/RadzenMenuItem.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<NavLink tabindex="-1" target="@Target" class="rz-navigation-item-link" href="@Path" Match="@Match">
1010
@if (!string.IsNullOrEmpty(Icon))
1111
{
12-
<i class="notranslate rzi rz-navigation-item-icon" style="@(!string.IsNullOrEmpty(IconColor) ? $"color:{IconColor}" : null)">@((MarkupString)Icon)</i>
12+
<i class="notranslate rzi rz-navigation-item-icon" style="@(!string.IsNullOrEmpty(IconColor) ? $"color:{IconColor}" : null)">@Icon</i>
1313
}
1414
@if (!string.IsNullOrEmpty(Image))
1515
{
@@ -34,7 +34,7 @@
3434
<div class="rz-navigation-item-link">
3535
@if (!string.IsNullOrEmpty(Icon))
3636
{
37-
<i class="notranslate rzi rz-navigation-item-icon" style="@(!string.IsNullOrEmpty(IconColor) ? $"color:{IconColor}" : null)">@((MarkupString)Icon)</i>
37+
<i class="notranslate rzi rz-navigation-item-icon" style="@(!string.IsNullOrEmpty(IconColor) ? $"color:{IconColor}" : null)">@Icon</i>
3838
}
3939
@if (!string.IsNullOrEmpty(Image))
4040
{

Radzen.Blazor/RadzenNotificationMessage.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
<div class="rz-notification-message-wrapper">
1111
<span class="notranslate rzi rz-notification-icon @classes.Item2" @onclick="NotificationClicked"></span>
1212
<div class="rz-notification-message" @onclick="NotificationClicked">
13-
<div class="rz-notification-title">@if (Message.SummaryContent != null) { @Message.SummaryContent(Service); } else { @((MarkupString)Message.Summary); }</div>
14-
<div class="rz-notification-content">@if (Message.DetailContent != null) { @Message.DetailContent(Service); } else { @((MarkupString)Message.Detail); }</div>
13+
<div class="rz-notification-title">@if (Message.SummaryContent != null) { @Message.SummaryContent(Service) } else { @Message.Summary }</div>
14+
<div class="rz-notification-content">@if (Message.DetailContent != null) { @Message.DetailContent(Service) } else { @Message.Detail }</div>
1515
</div>
1616
</div>
1717
<div class="notranslate rzi rz-notification-close" @onclick="@Close"></div>

Radzen.Blazor/RadzenPager.razor

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
@onfocus=@OnFocus>
77
@if(ShowPagingSummary)
88
{
9-
<span class="rz-pager-summary">@((MarkupString)string.Format(PagingSummaryFormat, CurrentPage + 1, numberOfPages, Count))</span>
9+
<span class="rz-pager-summary">@(string.Format(PagingSummaryFormat, CurrentPage + 1, numberOfPages, Count))</span>
1010
}
11-
<a d="@(GetId() + "fp")" class="rz-pager-first rz-pager-element @(skip > 0 ? "": "rz-state-disabled") @(focusedIndex == -2 ? "rz-state-focused": "")" @onclick:preventDefault="true" @onclick="@(() => OnFirstPageClick())" aria-label="@FirstPageAriaLabel" role="button" title="@FirstPageTitle" disabled="@(CurrentPage <= 0)">
11+
<a id="@(GetId() + "fp")" class="rz-pager-first rz-pager-element @(skip > 0 ? "": "rz-state-disabled") @(focusedIndex == -2 ? "rz-state-focused": "")" @onclick:preventDefault="true" @onclick="@(() => OnFirstPageClick())" aria-label="@FirstPageAriaLabel" role="button" title="@FirstPageTitle" disabled="@(CurrentPage <= 0)">
1212
<span class="notranslate rz-pager-icon rzi rzi-step-backward"></span>
1313
</a>
1414

15-
<a id="@(GetId() + "pp")" class="rz-pager-prev rz-pager-element @(skip > 0 ? "": "rz-state-disabled") @(focusedIndex == -1 ? "rz-state-focused": "")" @onclick:preventDefault="true" @onclick="@(() => OnPrevPageClick())" aria-label="@PrevPageAriaLabel" role="button" title="@PrevPageTitle" disabled="@(CurrentPage <= 0)">
15+
<a id="@(GetId() + "pp")" class="rz-pager-prev rz-pager-element @(skip > 0 ? "": "rz-state-disabled") @(focusedIndex == -1 ? "rz-state-focused": "")" @onclick:preventDefault="true" @onclick="@(() => OnPrevPageClick())" aria-label="@PrevPageAriaLabel" role="button" title="@PrevPageTitle" disabled="@(CurrentPage <= 0)">
1616
<span class="notranslate rz-pager-icon rzi rzi-caret-left"></span>
1717
@if (PrevPageLabel != null)
1818
{

Radzen.Blazor/RadzenPanel.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<div>
99
@if (!string.IsNullOrEmpty(Icon))
1010
{
11-
<i class="notranslate rzi" style="@(!string.IsNullOrEmpty(IconColor) ? $"color:{IconColor}" : null)">@((MarkupString)Icon)</i>
11+
<i class="notranslate rzi" style="@(!string.IsNullOrEmpty(IconColor) ? $"color:{IconColor}" : null)">@Icon</i>
1212
}
1313
@if (!string.IsNullOrEmpty(Text))
1414
{

Radzen.Blazor/RadzenPanelMenuItem.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<NavLink tabindex="-1" target="@Target" class=@(Selected ? "rz-navigation-item-link rz-navigation-item-link-active" : "rz-navigation-item-link") style="@(Parent?.DisplayStyle == MenuItemDisplayStyle.Icon?"margin-inline-end:0px;":"")" href="@Path" Match="@Match">
1111
@if (!string.IsNullOrEmpty(Icon) && (Parent?.DisplayStyle == MenuItemDisplayStyle.Icon || Parent?.DisplayStyle == MenuItemDisplayStyle.IconAndText))
1212
{
13-
<i class="notranslate rzi rz-navigation-item-icon" style="@getIconStyle()">@((MarkupString)Icon)</i>
13+
<i class="notranslate rzi rz-navigation-item-icon" style="@getIconStyle()">@Icon</i>
1414
}
1515
@if (!string.IsNullOrEmpty(Image) && (Parent?.DisplayStyle == MenuItemDisplayStyle.Icon || Parent?.DisplayStyle == MenuItemDisplayStyle.IconAndText))
1616
{
@@ -35,7 +35,7 @@
3535
<div class="rz-navigation-item-link" style="@(Parent?.DisplayStyle == MenuItemDisplayStyle.Icon?"margin-inline-end:0px;":"")" @onclick="@Toggle">
3636
@if (!string.IsNullOrEmpty(Icon) && (Parent?.DisplayStyle == MenuItemDisplayStyle.Icon || Parent?.DisplayStyle == MenuItemDisplayStyle.IconAndText))
3737
{
38-
<i class="notranslate rzi rz-navigation-item-icon" style="@getIconStyle()">@((MarkupString)Icon)</i>
38+
<i class="notranslate rzi rz-navigation-item-icon" style="@getIconStyle()">@Icon</i>
3939
}
4040
@if (!string.IsNullOrEmpty(Image) && (Parent?.DisplayStyle == MenuItemDisplayStyle.Icon || Parent?.DisplayStyle == MenuItemDisplayStyle.IconAndText))
4141
{

Radzen.Blazor/RadzenProfileMenuItem.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<NavLink tabindex="-1" target="@Target" class="rz-navigation-item-link" href="@Path" Match="@Match">
1010
@if (!string.IsNullOrEmpty(Icon))
1111
{
12-
<i class="notranslate rzi rz-navigation-item-icon" style="@(!string.IsNullOrEmpty(IconColor) ? $"color:{IconColor}" : null)">@((MarkupString)Icon)</i>
12+
<i class="notranslate rzi rz-navigation-item-icon" style="@(!string.IsNullOrEmpty(IconColor) ? $"color:{IconColor}" : null)">@Icon</i>
1313
}
1414
@if (!string.IsNullOrEmpty(Image))
1515
{
@@ -23,7 +23,7 @@
2323
<div class="rz-navigation-item-link" >
2424
@if (!string.IsNullOrEmpty(Icon))
2525
{
26-
<i class="notranslate rzi rz-navigation-item-icon">@((MarkupString)Icon)</i>
26+
<i class="notranslate rzi rz-navigation-item-icon">@Icon</i>
2727
}
2828
@if (!string.IsNullOrEmpty(Image))
2929
{

Radzen.Blazor/RadzenRadioButtonList.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
}
3535
else
3636
{
37-
<span class="rz-radiobutton-label">@((MarkupString)item.Text)</span>
37+
<span class="rz-radiobutton-label">@item.Text</span>
3838
}
3939
</div>
4040
}

Radzen.Blazor/RadzenSelectBar.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
{
2828
@if (!string.IsNullOrEmpty(item.Icon))
2929
{
30-
<i class="notranslate rzi rz-navigation-item-icon" style="margin-right:2px;@(!string.IsNullOrEmpty(item.IconColor) ? $"color:{item.IconColor}" : "")">@((MarkupString)item.Icon)</i>
30+
<i class="notranslate rzi rz-navigation-item-icon" style="margin-right:2px;@(!string.IsNullOrEmpty(item.IconColor) ? $"color:{item.IconColor}" : "")">@item.Icon</i>
3131
}
3232
@if (!string.IsNullOrEmpty(item.Image))
3333
{

Radzen.Blazor/RadzenSidebarToggle.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
@if (Visible)
33
{
44
<button aria-label="@ToggleAriaLabel" tabindex="0" @ref="@Element" style="@Style" @attributes="Attributes" class="@GetCssClass()" @onclick="@OnClick" id="@GetId()">
5-
<i class="notranslate rzi rz-display-flex rz-align-items-center">@(!string.IsNullOrWhiteSpace(Icon) ? $"{(MarkupString)Icon}" : "menu")</i>
5+
<i class="notranslate rzi rz-display-flex rz-align-items-center">@(!string.IsNullOrWhiteSpace(Icon) ? Icon : "menu")</i>
66
</button>
77
}

Radzen.Blazor/RadzenSplitButton.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
{
2626
@if (!string.IsNullOrEmpty(@Icon))
2727
{
28-
<i class="notranslate rz-button-icon-left rzi" style="@(!string.IsNullOrEmpty(IconColor) ? $"color:{IconColor}" : null)">@((MarkupString)Icon)</i>
28+
<i class="notranslate rz-button-icon-left rzi" style="@(!string.IsNullOrEmpty(IconColor) ? $"color:{IconColor}" : null)">@Icon</i>
2929
}
3030
@if (!string.IsNullOrEmpty(Image))
3131
{

Radzen.Blazor/RadzenSplitButtonItem.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<a id="@(SplitButton.SplitButtonId() + GetHashCode())" class="rz-menuitem-link">
66
@if (!string.IsNullOrEmpty(Icon))
77
{
8-
<span class="rz-menuitem-icon" style="@(!string.IsNullOrEmpty(IconColor) ? $"color:{IconColor}" : null)">@((MarkupString)Icon)</span>
8+
<span class="rz-menuitem-icon" style="@(!string.IsNullOrEmpty(IconColor) ? $"color:{IconColor}" : null)">@Icon</span>
99
}
1010
@if (!string.IsNullOrEmpty(Text))
1111
{

Radzen.Blazor/RadzenTabsItem.razor

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66
<a @onclick=@OnClick role="tab" @onclick:preventDefault="true" id="@($"{Tabs.Id}-tabpanel-{Index}-label")"
77
aria-selected=@(IsSelected? "true" : "false") aria-controls="@($"{Tabs.Id}-tabpanel-{Index}")" @onkeydown:stopPropagation>
88
@if (!string.IsNullOrEmpty(Icon))
9-
{
10-
<span class="notranslate rzi rz-tabview-icon" style="@(!string.IsNullOrEmpty(IconColor) ? $"color:{IconColor}" : null)">@((MarkupString)Icon)</span>
11-
}
12-
@if (Template != null)
13-
{
14-
@Template(this)
15-
}
16-
else
17-
{
18-
<span class="rz-tabview-title">@Text</span>
19-
}
9+
{
10+
<span class="notranslate rzi rz-tabview-icon" style="@(!string.IsNullOrEmpty(IconColor) ? $"color:{IconColor}" : null)">@Icon</span>
11+
}
12+
@if (Template != null)
13+
{
14+
@Template(this)
15+
}
16+
else
17+
{
18+
<span class="rz-tabview-title">@Text</span>
19+
}
2020
</a>
2121
</li>
2222
}

Radzen.Blazor/RadzenToggleButton.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
{
2929
@if (!string.IsNullOrEmpty(getIcon()))
3030
{
31-
<i class="notranslate rz-button-icon-left rzi" style="@(!string.IsNullOrEmpty(IconColor) ? $"color:{IconColor}" : null)">@((MarkupString)getIcon())</i>
31+
<i class="notranslate rz-button-icon-left rzi" style="@(!string.IsNullOrEmpty(IconColor) ? $"color:{IconColor}" : null)">@getIcon()</i>
3232
}
3333
@if (!string.IsNullOrEmpty(Image))
3434
{

Radzen.Blazor/RadzenTooltip.razor

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
<div class="rz-tooltip-content @getCssClass(tooltip)" style="@tooltip.Options.Style">
99
@if (!string.IsNullOrEmpty(tooltip.Options.Text))
1010
{
11-
<div>
12-
@((MarkupString)tooltip.Options.Text)
13-
</div>
11+
<div>@tooltip.Options.Text</div>
1412
}
1513
else if (tooltip.Options.ChildContent != null)
1614
{

Radzen.Blazor/RadzenUpload.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
@RenderInput()
1313
@if (!string.IsNullOrEmpty(Icon))
1414
{
15-
<i class="notranslate rzi" style="@(!string.IsNullOrEmpty(IconColor) ? $"color:{IconColor}" : null)">@((MarkupString)Icon)</i>
15+
<i class="notranslate rzi" style="@(!string.IsNullOrEmpty(IconColor) ? $"color:{IconColor}" : null)">@Icon</i>
1616
}
1717
<span class="rz-button-text">@ChooseText</span>
1818
</span>

Radzen.Blazor/Rendering/DialogContainer.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
}
1616
else
1717
{
18-
@((MarkupString)Dialog.Title)
18+
@Dialog.Title
1919
}
2020
</div>
2121
@if (Dialog.Options.ShowClose)

RadzenBlazorDemos/Pages/AutoCompleteBindValue.razor

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@
55

66
<div class="rz-p-12 rz-text-align-center">
77
<RadzenAutoComplete @bind-Value=@companyName Data=@customers TextProperty="@nameof(Customer.CompanyName)" Style="width: 13rem" InputAttributes="@(new Dictionary<string,object>(){ { "aria-label", "Company Name" }})" />
8-
<RadzenText TextStyle="TextStyle.Body2">Start typing e.g. France
9-
@((MarkupString)(!string.IsNullOrEmpty(companyName) ? $", Value is: <strong>{companyName}</strong>" : ""))</RadzenText>
8+
<RadzenText TextStyle="TextStyle.Body2">Start typing e.g. France</RadzenText>
9+
@if (!string.IsNullOrEmpty(companyName))
10+
{
11+
<RadzenText TextStyle="TextStyle.Body2">Value is: <strong>@companyName</strong></RadzenText>
12+
}
1013
</div>
1114

1215
@code {

RadzenBlazorDemos/Pages/AutoCompleteChangeEvent.razor

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@
55

66
<div class="rz-p-12 rz-text-align-center">
77
<RadzenAutoComplete Value=@companyName Change=@OnChange Data=@customers TextProperty="@nameof(Customer.CompanyName)" Style="width: 13rem" InputAttributes="@(new Dictionary<string,object>(){ { "aria-label", "Company Name" }})" />
8-
<RadzenText TextStyle="TextStyle.Body2">Start typing e.g. France
9-
@((MarkupString)(!string.IsNullOrEmpty(companyName) ? $", Value is: <strong>{companyName}</strong>" : ""))</RadzenText>
8+
<RadzenText TextStyle="TextStyle.Body2">Start typing e.g. France</RadzenText>
9+
@if (!string.IsNullOrEmpty(companyName))
10+
{
11+
<RadzenText TextStyle="TextStyle.Body2">Value is: <strong>@companyName</strong></RadzenText>
12+
}
1013
</div>
1114

1215
@code {

0 commit comments

Comments
 (0)