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

Diagram does not save RenderTransform of RadDiagramShape

1 Answer 72 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Yogendra
Top achievements
Rank 1
Yogendra asked on 05 Aug 2013, 10:46 AM

Hello

I am creating Diagram using this code:-
<telerik:RadDiagram x:Name="MyDiagram"  Grid.Row="1" IsConnectorsManipulationEnabled="False" IsEnabled="False" RectSelectionMode="Full" SelectionMode="Multiple" >
    <telerik:RadDiagram.Background>
        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FF12997A" Offset="0.017"/>
            <GradientStop Color="#FF93D61D" Offset="1"/>
            <GradientStop Color="#FF4425B0" Offset="0.209"/>
            <GradientStop Color="#FF5632CF" Offset="0.418"/>
            <GradientStop Color="#FF062780" Offset="0.582"/>
            <GradientStop Color="#FFB82424" Offset="0.728"/>
        </LinearGradientBrush>
    </telerik:RadDiagram.Background>
    <telerik:RadDiagramShape x:Name="ConditionShape"
        Width="80"
                              
        Content="condition"
        FontWeight="ExtraBold"
        Geometry="{telerik:FlowChartShape ShapeType=PredefinedShape}"
        Position="203,119" AllowDrop="False" BorderBrush="#FF3BB800" BorderThickness="30,0" FlowDirection="RightToLeft" FontSize="23" FontStyle="Italic" Foreground="#FF13F0D2" GlidingStyle="Ellipse" Margin="2,-41,21,62" OpacityMask="#FFD12727" Padding="-67,4,4,4" RenderTransformOrigin="0,0.5" RotationAngle="15" Stroke="#FF232C8F" StrokeThickness="15" TabIndex="2147483645" TextOptions.TextFormattingMode="Display" UseDefaultConnectors="False" UseLayoutRounding="False" FontFamily="CordiaUPC" >
        <telerik:RadDiagramShape.RenderTransform>
            <CompositeTransform SkewX="-55" SkewY="29" TranslateX="-48.557" TranslateY="-2.4E-05"/>
        </telerik:RadDiagramShape.RenderTransform>
        <telerik:RadDiagramShape.Projection>
            <PlaneProjection RotationX="-22" RotationY="-137" RotationZ="-40"/>
        </telerik:RadDiagramShape.Projection>
        <telerik:RadDiagramShape.Effect>
            <BlurEffect Radius="1"/>
        </telerik:RadDiagramShape.Effect>
        <telerik:RadDiagramShape.Background>
            <RadialGradientBrush>
                <GradientStop Color="#FFFFB356" Offset="1"/>
                <GradientStop Color="#FFFFDEDE"/>
                <GradientStop Color="#FF6BC740" Offset="0.5"/>
            </RadialGradientBrush>
        </telerik:RadDiagramShape.Background>
    </telerik:RadDiagramShape>
</telerik:RadDiagram>

I am saving diagram using this code:-
Dim str As String = MyDiagram.Save().ToString
Dim strC As String() = New String(1) {}
strC(0) = str
File.WriteAllText("C:\NewDiagram\Diagram.Txt", strC(0), System.Text.Encoding.UTF8)

And Load using this code:-
Dim str = File.ReadAllText("C:\NewDiagram\Diagram.Txt", System.Text.Encoding.UTF8)
MyDiagram.Load(str)


Diagram.Load method doesn't load RenderTransform of RadDiagramShape.

Please suggest me something to solve this problem.


1 Answer, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 08 Aug 2013, 07:08 AM
Hello Yogendra,

I am not sure that I fully understand your scenario. Can you please elaborate more on the transform that you need to save. Please have in mind that the RadDiagram.Save() method serialized only the basic properties for the RadDiagramShape and RadDiagramConnection (e.g. Background, Content, Position...) for full list of the properties that are serialized by default you can take a look at this article.

Basically, if you need to save a rotate transform you can manually serialize the RotationAngle property of the RadDiagramShape. The RadDiagram uses rotate transform to apply the rotation angle defined in that property. Furthermore, in order to save a ScaleTransform you can serialize the Zoom property of the RadDiagram. The control performs a scale transform in order to set the zoom index. Please note that this property is of the RadDiagram. This is why you need to subscribe to the Serialized/Deserialize events of the RadDiagram instead of subscribing to the ShapeSerialized/ShapeDeserialized events.

Please try the approach described in the referenced article and let us know if you have any other questions.

Regards,
Pavel R. Pavlov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
Diagram
Asked by
Yogendra
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Share this question
or