Skip to main content
All docs
V25.1
  • DevExpress v25.1 Update — Your Feedback Matters

    Our What's New in v25.1 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

    Take the survey Not interested

    DxWindow.MoveAsync(Double, Double, CancellationToken) Method

    Asynchronously moves the Window to the specified coordinates.

    Namespace: DevExpress.Blazor

    Assembly: DevExpress.Blazor.v25.1.dll

    NuGet Package: DevExpress.Blazor

    #Declaration

    C#
    public Task MoveAsync(
        double x,
        double y,
        CancellationToken token = default(CancellationToken)
    )

    #Parameters

    Name Type Description
    x Double

    The X coordinate of the window’s top left corner.

    y Double

    The Y coordinate of the window’s top left corner.

    #Optional Parameters

    Name Type Default Description
    token CancellationToken null

    An object that propagates a cancellation notification.

    #Returns

    Type Description
    Task

    An asynchronous operation that moves the Window.

    #Remarks

    The following code snippet moves the Window to the mouse click’s position.

    Razor
    <DxButton RenderStyle="ButtonRenderStyle.Secondary"
              Click="() => WindowVisible = !WindowVisible">SHOW A WINDOW</DxButton>
    
    <DxButton RenderStyle="ButtonRenderStyle.Secondary"
              Click="OnMoveAtClickPosition">MOVE THE WINDOW HERE</DxButton>
    
    <DxWindow @ref=Window
              @bind-Visible=WindowVisible
              HeaderText="Header"
              BodyText="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sit amet metus vel
                 nisi blandit tincidunt vel efficitur purus. Nunc nec turpis tempus, accumsan orci auctor,
                 imperdiet mauris. Fusce id purus magna."
              Width="max(25vw, 250px)">
    </DxWindow>
    
    @code {
        DxWindow Window;
        bool WindowVisible { get; set; } = false;
    
        async Task OnMoveAtClickPosition(MouseEventArgs args) {
            await Window.MoveAsync(args.ClientX, args.ClientY);
        }
    }
    
    See Also