DxWindow.AllowDrag Property
Specifies whether users can drag the Window.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v22.2.dll
NuGet Package: DevExpress.Blazor
Declaration
[DefaultValue(true)]
[Parameter]
public bool AllowDrag { get; set; }
Property Value
Type | Default | Description |
---|---|---|
Boolean | true |
|
Remarks
Set the AllowDrag
property to true
to allow users to drag the Window to a new position.
You can handle the following events to process drag actions:
- DragStarted - Fires when a user starts to drag the Window.
- DragCompleted - Fires after the Window is dragged.
<DxButton RenderStyle="ButtonRenderStyle.Secondary"
Click="() => windowVisible = !windowVisible">SHOW A WINDOW</DxButton>
<DxWindow @bind-Visible=windowVisible
PositionX="positionX"
PositionY="positionY"
AllowDrag=true
DragCompleted="OnWindowDragCompleted"
ShowCloseButton="true"
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 {
int positionX = 250, positionY = 250;
bool windowVisible;
void OnWindowDragCompleted(WindowDragCompletedEventArgs args) {
(positionX, positionY) = (args.End.X, args.End.Y);
}
}
See Also