Created
January 25, 2024 12:42
-
-
Save bjoerntx/0158a72e11a433e0c3d9490dad3785be to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@page "/" | |
@rendermode @(new InteractiveServerRenderMode(false)) | |
@inject NavigationManager Navigator; | |
<PageTitle>Home</PageTitle> | |
<TextControl WebSocketURL=@Navigator.BaseUri | |
ContainerID="txDocumentEditorContainer" | |
@ref="_txtextcontrol"> | |
</TextControl> | |
<button @onclick="InsertTable">Insert Table</button> | |
<button @onclick="SaveDocument"> | |
Save and Reload Document (using ServerTextControl) | |
</button> | |
@code | |
{ | |
private TextControl _txtextcontrol = default!; | |
// insert a table using the client-side API | |
private async Task InsertTable() | |
{ | |
await _txtextcontrol.InsertTable(); | |
} | |
// save the document and reload it using ServerTextControl | |
private async Task SaveDocument() | |
{ | |
await _txtextcontrol.SaveDocument(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment