Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to bind value to c# object. #107

Closed
mpicca1 opened this issue Sep 25, 2023 · 2 comments
Closed

Unable to bind value to c# object. #107

mpicca1 opened this issue Sep 25, 2023 · 2 comments

Comments

@mpicca1
Copy link

mpicca1 commented Sep 25, 2023

Hello, how do I @bind-Value to this component? I want to link the data. Is there a way to data-bind the value to a string or a string property of an object?

@35P10
Copy link

35P10 commented Nov 29, 2023

Hi, try this:

<StandaloneCodeEditor @ref="_editor"  OnDidChangeModelContent="HandleInput">

@code
{
     private string code = "";
     private StandaloneCodeEditor _editor = null!;
     
     private async Task HandleInput(ModelContentChangedEvent e)
     {
          code = await _editor.GetValue();
     }
}

It works for me.

@serdarciplak
Copy link
Owner

Duplicate of #55

@serdarciplak serdarciplak marked this as a duplicate of #55 Jan 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants