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

Customize send to forward,backward option in SettingsPaneHomeControl

1 Answer 127 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Dipti
Top achievements
Rank 1
Dipti asked on 14 Jul 2017, 12:12 PM

Hello,

In my code, for Raddiagram, default SettingsPaneHomeControl is used. In that there are options such as Bring to Front,Back,Forward,Backward.

Bring to Back, Front works properly. But Bring to forward, backward does not detect first click, and after second it works properly for some diagrams, and for some diagrams it does not work.

How i should i debug this? 

Is there any way i can change its properties?

 

Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 18 Jul 2017, 08:37 AM
Hello Dipti,

I am not aware of any issues with the bring forward and backward commands. What they do basically is changing the ZIndex property of the selected diagram item. I guess the experienced behavior comes from the way the stack order works. Basically, the stack order of the diagram elements is determined by two factors - the ZIndex property and the order in the children collection. For example, if two shapes has ZIndex 0, the one that has bigger index in the collection that holds it will be displayed on top. Probably, this is why you need to click the button twice. 

You can extend the commands behavior by subscribing for the CommandExecuted event of RadDiagram and update the ZIndex property of the shapes you want.
private void diagram_CommandExecuted(object sender, Telerik.Windows.Controls.Diagrams.CommandRoutedEventArgs e)
{           
    if (e.Command.Name.Equals("Bring Forward"))
    {
        // update ZIndex(es) if necessary
    }
}

If you want to customize the settings pane of the diagram you can check the CustomSettingsPane SDK example.

Regards,
Martin Ivanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
Diagram
Asked by
Dipti
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or