hello,
I'm looking for a solution to the problem shown by the following code snippet. As you can see, it's a simple component that opens a Dialog in which there is a button that increments a counter. The counter value is displayed in both the component and the Dialog. When I click on the button I can see the updated value in the component but not in the Dialog. To get the update in the Dialog I just have to move it around a bit (it's draggable).
@inject DialogService dialogService;
<h3>TestDialog</h3>
<RadzenText Text=@counter.ToString() />
<br />
<RadzenButton Text="Open Dialog" Click="OpenDialog" />
@code {
int counter = 0;
private void Click()
{
counter++;
}
private async void OpenDialog()
{
await dialogService.OpenAsync("Dialog", ds => @DialogFragment(),
new DialogOptions()
{
Width = "980px",
Resizable = true,
Draggable = true
}
);
}
private RenderFragment DialogFragment()
{
return
@<RadzenCard>
<RadzenText Text=@counter.ToString() />
<br />
<RadzenButton Text="Click me" Click="Click" />
</RadzenCard>;
}
}
Is there anything I can do to get the correct behavior?
Thank you very much