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

Change programmaticaly style for container

3 Answers 63 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
nicolasf
Top achievements
Rank 2
nicolasf asked on 22 Nov 2017, 08:57 PM

Hi,

I have an application with Diagram using GraphSource.
Actually i add Container with default styledefine by StyleSelector and i would like to allow my user to choose a different style.
How can i do this ? If i use SelectedItem, i have a model not a shape or container so i can't define style.

Thanks for your help.

Nicolas

3 Answers, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 27 Nov 2017, 12:11 PM
,

To get the container shape from your model you can use the ContainerGenerator property and more specifically the ContainerFromItem() method.
var containerShape = this.diagram.ContainerGenerator.ContainerFromItem(this.diagram.SelectedItem);

Regards,
Dinko
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 you to write beautiful native mobile apps using a single shared C# codebase.
0
nicolasf
Top achievements
Rank 2
answered on 27 Nov 2017, 12:43 PM
thanks for the explanation, i'll try this code tonight.
0
nicolasf
Top achievements
Rank 2
answered on 03 Dec 2017, 07:17 PM
thanks, that's working !
Tags
Diagram
Asked by
nicolasf
Top achievements
Rank 2
Answers by
Dinko | Tech Support Engineer
Telerik team
nicolasf
Top achievements
Rank 2
Share this question
or