This is a migrated thread and some comments may be shown as answers.

Change DiagramCommands.SendBackward behavior

1 Answer 44 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Dario Concilio
Top achievements
Rank 2
Dario Concilio asked on 13 Jun 2017, 11:41 AM

Hi,

I would that SendBackward command set Z-Index to penultimate item and not last one.

Moreover SendToBack decreases Z-Index but until  to penultimate item.

I would this behavior because, I have ever a rectangle called "MainContainer" that "contains" other rectangles, but actually is only showed as last one under other ones, and it has to ever last one then it has to ever lowest Z-Index.

How can I do this?

1 Answer, 1 is accepted

Sort by
0
Dario Concilio
Top achievements
Rank 2
answered on 14 Jun 2017, 11:46 AM

I found it.....

private void topRadDiagram_CommandExecuted(object sender, CommandRoutedEventArgs e)
{
    //Indietro
    if (e.Command.Name == "Send Backward")
    {
        foreach (RadDiagramShape item in this.topRadDiagram.SelectedItems)
        {
            if (item.ZIndex < 2)
                item.ZIndex = 2;
        }
    }
 
    //Secondo piano
    if (e.Command.Name == "Send To Back")
    {
        foreach (RadDiagramShape item in this.topRadDiagram.SelectedItems)
        {
            if (item.ZIndex < 2)
                item.ZIndex = 2;
        }
    }
 
}
Tags
Diagram
Asked by
Dario Concilio
Top achievements
Rank 2
Answers by
Dario Concilio
Top achievements
Rank 2
Share this question
or