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

Edit Shape on runtime

1 Answer 64 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
ITA asked on 02 Apr 2014, 06:36 AM

we crearte the Shapes like this:

MyGallery secondGallery = new MyGallery { Header = "Shapes" };
secondGallery.Shapes.Add(new Switch
         SN = "222",
         Content = "Start",
         Height = 80,
         Width = 80,
         Backcolor = "#009494",
         Forecolor = "#ffffff",
         Geometry = ShapeFactory.GetShapeGeometry(CommonShapeType.EllipseShape),
         Manufacturer = "Manufacturer 2.2"

then we bin the Shapes to the toolbox

<!--  ToolboxItemTemplate  -->
<DataTemplate x:Key="ToolboxItemTemplate1">
   <Border Width="130"
                   Margin="0 1 1 0"
                 <RowDefinition Height="*" />                           
             <Viewbox Grid.Row="0" Width="{Binding Width}" Height="{Binding Height}" Margin="5 10 5 0"   HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="Fill">
                  <telerik:RadDiagramShape Margin="15" VerticalAlignment="Top" HorizontalContentAlignment="Center"               VerticalContentAlignment="Center" FontWeight="Bold"
                                                     Geometry="{Binding Geometry}" IsHitTestVisible="False" Content="{Binding Content}" FontSize="15" Foreground="{Binding Forecolor}"
                                                     Background="{Binding Backcolor}">   
<!--  ToolboxGroupTemplate  -->
<HierarchicalDataTemplate x:Key="ToolboxGroupTemplate1"
                            ItemsSource="{Binding Shapes}"
                            ItemTemplate="{StaticResource ToolboxItemTemplate1}">
     <TextBlock Text="{Binding Header}" FontSize="13" />

For example we habe a simple RectangleShape. With a cutom Tab in EditMode we select a Employee and now we want to edit the RectangleShape. Is it possible to change the view of the RectangleShape during runtim, for example see attached files.

Thanks a lot
Best Regards

1 Answer, 1 is accepted

Sort by
Pavel R. Pavlov
Telerik team
answered on 04 Apr 2014, 07:02 AM

Could you please be more specific on what you need to change of the RadDiagramShape at runtime? Is that green square part of the default Template of the RadDiagramShape? Is it an option for you to change the visibility of the square at runtime?

Pavel R. Pavlov

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Asked by
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Share this question