Edit Shape on runtime

2 posts, 1 answers
  1. ITA
    ITA avatar
    384 posts
    Member since:
    Aug 2009

    Posted 02 Apr 2014 Link to this post


    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
  2. Answer
    Pavel R. Pavlov
    Pavel R. Pavlov avatar
    1237 posts

    Posted 04 Apr 2014 Link to this post


    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.

Back to Top