Skip to main content
All docs
V26.1
  • DxAIChat.BindValueMode Property

    Specifies how the AI Chat component commits user input to the internal message text buffer that is sent to the chat.

    Namespace: DevExpress.AIIntegration.Blazor.Chat

    Assembly: DevExpress.AIIntegration.Blazor.Chat.v26.1.dll

    Declaration

    [DefaultValue(BindValueMode.OnInput)]
    [Parameter]
    public BindValueMode BindValueMode { get; set; }

    Property Value

    Type Default Description
    BindValueMode OnInput

    A BindValueMode enumeration value.

    Available values:

    Name Description
    OnLostFocus

    The editor value is updated after the editor loses focus.

    OnInput

    The editor value is updated whenever a user types.

    OnDelayedInput

    The editor value is updated with a delay after a user makes changes.

    Remarks

    The DxAIChat component uses an internal buffer to store the message text. This buffer is automatically synchronized with the content of the chat input box. The BindValueMode property specifies when the synchronization happens.

    Important

    The chat input box displays typed text immediately, regardless of the BindValueMode value.

    OnInput Mode

    The text buffer is updated whenever a user modifies the input field value.

    <DxAIChat BindValueMode="BindValueMode.OnInput" />
    

    OnLostFocus Mode

    The text buffer is updated after the input field loses focus:

    <DxAIChat BindValueMode="BindValueMode.OnLostFocus" />
    

    OnDelayedInput Mode

    The text buffer is updated if a user is idle for a certain period (a user stopped typing). To change the idle time interval, use the InputDelay property. The countdown is restarted after each change to the input field value.

    The delay reduces the number of updates while a user is typing and can improve AI Chat performance in Interactive WebAssembly or Interactive Auto render modes. The default value of the InputDelay property is 500 ms. Adjust the value depending on your goals:

    • Decrease the delay to make the chat feel more responsive.
    • Increase the delay to improve performance on slower devices.

    OnDelayedInput mode changes the AI Chat input box behavior as follows:

    • If a user starts with an empty input box, the Send button remains disabled until the user types something and then is inactive for the number of milliseconds specified by InputDelay.
    • The Send button is disabled if a user clears the input box and is inactive for the number of milliseconds specified by InputDelay.
    • If a user clicks Send before the delay elapses, the component sends the previously buffered message. The buffered message may differ from the text currently displayed in the input box.

    The following code snippet shows an AI Chat component that updates the internal message text buffer after the user is idle for 1 second (1,000 ms):

    <DxAIChat BindValueMode="BindValueMode.OnDelayedInput"
              InputDelay="1000" />
    
    See Also