Rotate Command in WPF Diagram (SfDiagram)

29 Jan 20251 minute to read

The Rotate Command is used to rotate the elements in diagram. The RotateParameter is used to represent RotationDirection and Angle to rotate the element in diagram.

<Syncfusion:RotateParameter RotationDirection="Clockwise" Angle="45"  x:Key="RotateCommandParameter"/>

<Button Height="50" Content="Rotate" Name="RotateCommand" Command="Syncfusion:DiagramCommands.Rotate" CommandParameter="{StaticResource RotateCommandParameter }"></Button>
IGraphInfo graphinfo = diagramcontrol.Info as IGraphInfo;

graphinfo.Commands.Rotate.Execute(new RotateParameter() 
{ 
    RotationDirection=RotationDirection.Clockwise,
    Angle=45
});

Gif for Rotate command

View sample in GitHub