Пример #1
0
        private async Task SetCurrentScript(string script, string style = null)
        {
            // Temporarily suspend any dynamic updates
            _updateDynamic = false;
            Update(null);

            // Update the script
            if (!string.IsNullOrWhiteSpace(script))
            {
                await _scriptEditor.SetValue(script);

                if (!string.IsNullOrWhiteSpace(style))
                {
                    await _styleEditor.SetValue(style);
                }

                // Update the preview
                await RenderPreview();

                _loading = 0;
                StateHasChanged();
            }

            // Enable dynamic updates again
            _updateDynamic = true;
        }
Пример #2
0
 public async Task SetValue()
 {
     Console.WriteLine($"setting value to: {Value}");
     await _editor.SetValue(Value);
 }