CharacterProperties.Hidden Property
Specifies whether content is hidden.
Namespace: DevExpress.Blazor.RichEdit
Assembly: DevExpress.Blazor.RichEdit.v24.2.dll
NuGet Package: DevExpress.Blazor.RichEdit
#Declaration
public bool? Hidden { get; set; }
#Property Value
Type | Description |
---|---|
Nullable<Boolean> |
|
#Remarks
The Hidden
property defines whether content is hidden. Select the Home → Show/Hide ¶ ribbon command to show/hide hidden content. The Rich Text Editor underlines hidden content with the dotted line.
Use a text span’s Hidden or a table cell’s CharacterProperties.Hidden property to identify whether content in the span or cell is hidden. Call the TextSpan.ChangePropertiesAsync or TableCell.ChangePropertiesAsync method to show or hide content.
The following example hides a text span’s content:
<DxRichEdit @ref="richEdit" />
@code {
DxRichEdit richEdit;
Document documentAPI;
protected override async Task OnAfterRenderAsync(bool firstRender) {
if (firstRender)
try {
await InitializeDocument();
}
catch (TaskCanceledException) { }
await base.OnAfterRenderAsync(firstRender);
}
async Task InitializeDocument() {
/* Surround the code that contains an asynchronous operation with a try-catch block to handle
the OperationCanceledException. This exception is thrown when an asynchronous operation is canceled. */
try {
documentAPI = richEdit.DocumentAPI;
TextSpan characters = await documentAPI.AddTextAsync("New Text");
await characters.ChangePropertiesAsync(properties => {
properties.Hidden = true;
});
}
catch (OperationCanceledException e) {
Console.WriteLine($"{nameof(OperationCanceledException)} thrown with message: {e.Message}");
}
}
}