<ResourceDictionary
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
        xmlns:c="http://schemas.telerik.com/2008/xaml/compile"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="c"
        xmlns:diagramscontrols="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Diagrams"
        xmlns:primitives="clr-namespace:Telerik.Windows.Controls.Diagrams.Primitives;assembly=Telerik.Windows.Controls.Diagrams"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        xmlns:diagrams="clr-namespace:Telerik.Windows.Controls.Diagrams;assembly=Telerik.Windows.Controls.Diagrams">
    <sys:Double x:Key="DiagramConnectorWidth">7</sys:Double>
    <sys:Double x:Key="DiagramConnectorHeight">7</sys:Double>
    <Thickness x:Key="DiagramConnectorThickness">1</Thickness>
    <sys:Double x:Key="ResizingRectangleWidth">7</sys:Double>
    <sys:Double x:Key="ResizingRectangleHeight">7</sys:Double>
    <sys:Double x:Key="ResizingRectangleStrokeThickness">1</sys:Double>
    <sys:Double x:Key="ManipulationAdornerWidth">13</sys:Double>
    <sys:Double x:Key="ManipulationAdornerHeight">13</sys:Double>
    <sys:Double x:Key="ManipulationAdornerResizeActivationRadius">3</sys:Double>
    <Thickness x:Key="ManipulationAdornerThicknessL">-3 -3 0 0</Thickness>
    <Thickness x:Key="ManipulationAdornerThicknessT">0 -3 -3 0</Thickness>
    <Thickness x:Key="ManipulationAdornerThicknessR">-3 0 0 -3</Thickness>
    <Thickness x:Key="ManipulationAdornerThicknessB">0 0 -3 -3</Thickness>
    <sys:Double x:Key="DiagramShapeFontSize">11</sys:Double>
    <sys:Double x:Key="DiagramContainerShapeFontSize">11</sys:Double>
    <Thickness x:Key="DiagramContainerShapePadding">4</Thickness>
    <LinearGradientBrush x:Key="DiagramShape_Background" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FFC4C4C4" Offset="0.92"/>
        <GradientStop Color="White"/>
        <GradientStop Color="#FFE2E0E0" Offset="0.5"/>
        <GradientStop Color="#FFF1F1F1" Offset="0.49"/>
        <GradientStop Color="#FFE5E5E5" Offset="1"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="DiagramShape_BorderBrush" Color="#FF6C6C6C"/>
    <SolidColorBrush x:Key="DiagramShape_Selected_BorderBrush" Color="#B23399FF"/>
    <SolidColorBrush x:Key="DiagramShape_ActiveSelected_BorderBrush" Color="#7FB94630"/>
    <SolidColorBrush x:Key="DiagramShape_Foreground" Color="#FF333333"/>
    <SolidColorBrush x:Key="DiagramShape_EditTextBox_BorderBrush" Color="#FF3C7FB1"/>
    <SolidColorBrush x:Key="DiagramShape_EditTextBox_Background" Color="#FFFFFFFF"/>
    <SolidColorBrush x:Key="DiagramShape_Connection_Background" Color="#FF333333"/>
    <SolidColorBrush x:Key="DiagramShape_Connection_BorderBrush" Color="#FF3F3F3F"/>
    <SolidColorBrush x:Key="DiagramContainerShape_Background" Color="White"/>
    <SolidColorBrush x:Key="DiagramContainerShapeForeground" Color="Black"/>
    <SolidColorBrush x:Key="DiagramContainerShape_BorderBrush" Color="#FF83A5D2"/>
    <SolidColorBrush x:Key="DiagramContainerShape_Collapsed_Fill" Color="Black"/>
    <SolidColorBrush x:Key="DiagramControl_ShapeManipulation_BorderBrush" Color="#FF3C7FB1"/>
    <LinearGradientBrush x:Key="DiagramControl_ShapeManipulation_Background" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FFE5F4FD"/>
        <GradientStop Color="#FF8FC9E8" Offset="1"/>
        <GradientStop Color="#FFC4E5F6" Offset="0.578"/>
        <GradientStop Color="#FF98D1EF" Offset="0.578"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="DiagramControl_Connector_BorderBrush" Color="#FF3C7FB1"/>
    <LinearGradientBrush x:Key="DiagramControl_Connector_Background" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FFE5F4FD"/>
        <GradientStop Color="#FF8FC9E8" Offset="1"/>
        <GradientStop Color="#FFC4E5F6" Offset="0.578"/>
        <GradientStop Color="#FF98D1EF" Offset="0.578"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="DiagramControl_ShapeManipulation_MouseOver_BorderBrush" Color="#FF0A5276"/>
    <LinearGradientBrush x:Key="DiagramControl_ShapeManipulation_MouseOver_Background" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FF83ABC0" Offset="0"/>
        <GradientStop Color="#FF4D95A9" Offset="1"/>
        <GradientStop Color="#FF3F7E9D" Offset="0.578"/>
        <GradientStop Color="#FF0A5276" Offset="0.578"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="DiagramControl_ShapeManipulation_Selected_BorderBrush" Color="#FFB94630"/>
    <LinearGradientBrush x:Key="DiagramControl_ShapeManipulation_Selected_Background" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FFF4CAC2" Offset="0"/>
        <GradientStop Color="#FFCC7D6D" Offset="0.578"/>
        <GradientStop Color="#FFB94630" Offset="0.578"/>
        <GradientStop Color="#FFBE7360" Offset="1"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="DiagramControl_ManipulationAdorner_Background" Color="#00FFFFFF"/>
    <SolidColorBrush x:Key="DiagramControl_ManipulationAdorner_BorderBrush" Color="#FF3C7FB1"/>
    <LinearGradientBrush x:Key="DiagramControl_RotationPath_Fill" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FF3F7E9D"/>
        <GradientStop Color="#FF0A5276" Offset="1"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="DiagramControl_RotationPath_Stroke" Color="Transparent"/>
    <LinearGradientBrush x:Key="DiagramControl_TipPanel_Background" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FF83ABC0" Offset="0"/>
        <GradientStop Color="#FF4D95A9" Offset="1"/>
        <GradientStop Color="#FF3F7E9D" Offset="0.5"/>
        <GradientStop Color="#FF0A5276" Offset="0.5"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="DiagramControl_TipPanel_BorderBrush" Color="#FF000000"/>
    <SolidColorBrush x:Key="DiagramControl_TipPanel_Foreground" Color="#FFFFFFFF"/>
    <CornerRadius x:Key="DiagramControl_TipPanel_CornerRadius">2</CornerRadius>
    <SolidColorBrush x:Key="Diagram_BackgroundGrid" Color="Transparent"/>
    <SolidColorBrush x:Key="Diagram_BorderBrushGrid" Color="#FFDCDCDC"/>
    <SolidColorBrush x:Key="Diagram_SelectionRectangle_BorderBrush" Color="#FF3C7FB1"/>
    <SolidColorBrush x:Key="Diagram_SelectionRectangle_Background" Color="Transparent"/>
    <sys:Double x:Key="Diagram_BackgroundGridWidth">20</sys:Double>
    <sys:Double x:Key="Diagram_BackgroundGridHeight">20</sys:Double>
    <SolidColorBrush x:Key="Diagram_Group_BorderBrush" Color="LightBlue"/>
    <SolidColorBrush x:Key="DiagramControl_ConnectionAdorner_BorderBrush" Color="Gray"/>
    <telerik:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
    <Style TargetType="diagramscontrols:RadDiagram" x:Key="RadDiagramStyle">
        <Setter Property="AllowDrop" Value="True"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled"/>
        <Setter Property="primitives:GraphPaper.CellSize">
            <Setter.Value>
                <Size Width="{StaticResource Diagram_BackgroundGridWidth}" Height="{StaticResource Diagram_BackgroundGridHeight}"/>
            </Setter.Value>
        </Setter>
        <Setter Property="primitives:BackgroundGrid.LineStroke" Value="{StaticResource Diagram_BorderBrushGrid}"/>
        <Setter Property="primitives:BackgroundGrid.CellSize">
            <Setter.Value>
                <Size Width="{StaticResource Diagram_BackgroundGridWidth}" Height="{StaticResource Diagram_BackgroundGridHeight}"/>
            </Setter.Value>
        </Setter>
        <Setter Property="primitives:BackgroundPageGrid.LineStroke" Value="{StaticResource DiagramShape_Selected_BorderBrush}"/>
        <Setter Property="primitives:DrawingAdorner.Fill" Value="{StaticResource DiagramShape_Background}"/>
        <Setter Property="primitives:DrawingAdorner.Stroke" Value="{StaticResource DiagramShape_BorderBrush}"/>
        <Setter Property="primitives:DrawingAdorner.StrokeThickness" Value="1"/>
        <Setter Property="KeyboardNavigation.TabNavigation" Value="Cycle"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Background" Value="{StaticResource Diagram_BackgroundGrid}"/>
        <Setter Property="BorderBrush" Value="{StaticResource Diagram_BorderBrushGrid}"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="SelectionRectangleStyle">
            <Setter.Value>
                <Style TargetType="Rectangle">
                    <Setter Property="StrokeDashArray" Value="3 3"/>
                    <Setter Property="Stroke" Value="{StaticResource Diagram_SelectionRectangle_BorderBrush}"/>
                    <Setter Property="Fill" Value="{StaticResource Diagram_SelectionRectangle_Background}"/>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="GroupStyle">
            <Setter.Value>
                <Style TargetType="Rectangle">
                    <Setter Property="StrokeThickness" Value="2"/>
                    <Setter Property="Stroke" Value="{StaticResource Diagram_Group_BorderBrush}"/>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="diagramscontrols:RadDiagram">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Border
                                Background="{TemplateBinding Background}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                Grid.ColumnSpan="2"
                                Grid.RowSpan="2"/>
                        <Grid>
                            <Grid x:Name="BackPanel" Visibility="{Binding Path=IsBackgroundSurfaceVisible, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToVisibilityConverter}}">
                                <primitives:BackgroundGrid x:Name="BackgroundGrid"/>
                                <primitives:BackgroundPageGrid x:Name="BackgroundPageGrid"/>
                            </Grid>
                            <Grid x:Name="TouchablePanel" Background="Transparent">
                                <Grid x:Name="MainPanel" RenderTransformOrigin="0.5, 0.5">
                                    <diagrams:DiagramSurface x:Name="ItemsHost" Background="Transparent"/>
                                    <primitives:AdornerSurface Background="{x:Null}">
                                        <Rectangle x:Name="SelectionRectangle" Visibility="Collapsed" Style="{TemplateBinding SelectionRectangleStyle}"/>
                                        <primitives:ConnectionManipulationAdorner x:Name="ConnectionManipulationAdorner" Visibility="Collapsed"/>
                                        <primitives:GroupsAdorner x:Name="GroupsAdorner" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
                                        <primitives:AlignmentAdorner x:Name="AlignmentAdorner" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
                                        <primitives:DrawingAdorner x:Name="DrawingAdorner" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
                                    </primitives:AdornerSurface>
                                </Grid>
                                <Canvas x:Name="ManipulationAdornerHost">
                                    <primitives:ManipulationAdorner x:Name="ManipulationAdorner" IsScalingEnabled="False" ZoomLevel="{TemplateBinding Zoom}" Visibility="Collapsed"/>
                                </Canvas>
                            </Grid>
                            <primitives:AdornerSurface x:Name="FrontPanel" Visibility="{Binding Path=IsInformationAdornerVisible, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToVisibilityConverter}}">
                                <primitives:ItemInformationAdorner x:Name="ItemInformationAdorner"/>
                            </primitives:AdornerSurface>
                        </Grid>
                        <Rectangle Grid.Row="1" Grid.Column="1" Fill="{StaticResource Diagram_BackgroundGrid}"/>
                        <ScrollBar x:Name="HorizontalScrollbar"
                                Orientation="Horizontal"
                                HorizontalAlignment="Stretch"
                                VerticalAlignment="Bottom"
                                Grid.Row="1"
                                Grid.Column="0"
                                telerik:TouchManager.IsTouchHitTestVisible="False"/>
                        <ScrollBar x:Name="VerticalScrollbar"
                                Orientation="Vertical"
                                HorizontalAlignment="Right"
                                VerticalAlignment="Stretch"
                                Grid.Row="0"
                                Grid.Column="1"
                                telerik:TouchManager.IsTouchHitTestVisible="False"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="diagramscontrols:RadDiagram" BasedOn="{StaticResource RadDiagramStyle}"/>
    <telerik:BooleanToVisibilityConverter x:Key="converter"/>
    <telerik:InvertedBooleanToVisibilityConverter x:Key="invertedBooleanToVisibilityConverter"/>
    <Style TargetType="TextBlock" x:Key="PositionTipTextBlockStyle">
        <Setter Property="FontWeight" Value="Bold"/>
    </Style>
    <Style TargetType="StackPanel" x:Key="infoTipPanel">
        <Setter Property="Orientation" Value="Horizontal"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="Margin" Value="10 2"/>
    </Style>
    <DataTemplate x:Key="PositionTipTemplate">
        <StackPanel Style="{StaticResource infoTipPanel}">
            <TextBlock Text="{telerik:LocalizableResource Key=PositionX}" Style="{StaticResource PositionTipTextBlockStyle}"/>
            <TextBlock Text="{Binding Path=X, StringFormat=n2}" Margin="2 0 0 0"/>
            <TextBlock Text="{telerik:LocalizableResource Key=PositionY}" Style="{StaticResource PositionTipTextBlockStyle}" Margin="5 0 0 0"/>
            <TextBlock Text="{Binding Path=Y, StringFormat=n2}" Margin="2 0 0 0"/>
        </StackPanel>
    </DataTemplate>
    <DataTemplate x:Key="RotationTipTemplate">
        <StackPanel Style="{StaticResource infoTipPanel}">
            <TextBlock Text="{telerik:LocalizableResource Key=RotationAngle}" Style="{StaticResource PositionTipTextBlockStyle}"/>
            <TextBlock Text="{Binding Path=., StringFormat=n0}" Margin="2 0 0 0"/>
        </StackPanel>
    </DataTemplate>
    <DataTemplate x:Key="SizeTipTemplate">
        <StackPanel Style="{StaticResource infoTipPanel}">
            <TextBlock Style="{StaticResource PositionTipTextBlockStyle}" Text="{telerik:LocalizableResource Key=Width}"/>
            <TextBlock Text="{Binding Width, StringFormat=n2}" Margin="2 0 0 0"/>
            <TextBlock Style="{StaticResource PositionTipTextBlockStyle}" Text="{telerik:LocalizableResource Key=Height}" Margin="5 0 0 0"/>
            <TextBlock Text="{Binding Height, StringFormat=n2}" Margin="2 0 0 0"/>
        </StackPanel>
    </DataTemplate>
    <primitives:InformationTipTemplateSelector x:Key="informationTemplateSelector"
            SizeChangedTemplate="{StaticResource SizeTipTemplate}"
            PositionChangedTemplate="{StaticResource PositionTipTemplate}"
            RotationChangedTemplate="{StaticResource RotationTipTemplate}"/>
    <Style TargetType="Rectangle" x:Key="ResizingRectangleStyle">
        <Setter Property="Width" Value="{StaticResource ResizingRectangleWidth}"/>
        <Setter Property="Height" Value="{StaticResource ResizingRectangleHeight}"/>
        <Setter Property="Stroke" Value="{StaticResource DiagramControl_ShapeManipulation_BorderBrush}"/>
        <Setter Property="Fill" Value="{StaticResource DiagramControl_ShapeManipulation_Background}"/>
        <Setter Property="StrokeThickness" Value="{StaticResource ResizingRectangleStrokeThickness}"/>
        <Setter Property="Visibility" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsResizingEnabled, Converter={StaticResource converter}}"/>
    </Style>
    <Style TargetType="primitives:ConnectorsControl" x:Key="ConnectorsControlStyle">
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <primitives:ConnectorsPanel/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="primitives:ConnectorsControl">
                    <ItemsPresenter/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="primitives:ManipulationAdorner" x:Key="ManipulationAdornerStyle">
        <Setter Property="RenderTransformOrigin" Value="0.5 0.5"/>
        <Setter Property="Width" Value="36"/>
        <Setter Property="Height" Value="36"/>
        <Setter Property="Background" Value="{StaticResource DiagramControl_ManipulationAdorner_Background}"/>
        <Setter Property="BorderBrush" Value="{StaticResource DiagramControl_ManipulationAdorner_BorderBrush}"/>
        <Setter Property="ResizeActivationRadius" Value="{StaticResource ManipulationAdornerResizeActivationRadius}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="primitives:ManipulationAdorner">
                    <Grid>
                        <Rectangle Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeDashArray="3 3" StrokeThickness="1" IsHitTestVisible="False"/>
                        <Rectangle x:Name="TopLeftResizeHandle"
                                Style="{StaticResource ResizingRectangleStyle}"
                                Margin="{StaticResource ManipulationAdornerThicknessL}"
                                VerticalAlignment="Top"
                                HorizontalAlignment="Left">
                            <ToolTipService.ToolTip>
                                <ToolTip Content="{telerik:LocalizableResource Key=Diagram_Resize}"/>
                            </ToolTipService.ToolTip>
                        </Rectangle>
                        <Rectangle x:Name="TopRightResizeHandle"
                                Style="{StaticResource ResizingRectangleStyle}"
                                Margin="{StaticResource ManipulationAdornerThicknessT}"
                                VerticalAlignment="Top"
                                HorizontalAlignment="Right">
                            <ToolTipService.ToolTip>
                                <ToolTip Content="{telerik:LocalizableResource Key=Diagram_Resize}"/>
                            </ToolTipService.ToolTip>
                        </Rectangle>
                        <Rectangle x:Name="BottomLeftResizeHandle"
                                Style="{StaticResource ResizingRectangleStyle}"
                                Margin="{StaticResource ManipulationAdornerThicknessR}"
                                VerticalAlignment="Bottom"
                                HorizontalAlignment="Left">
                            <ToolTipService.ToolTip>
                                <ToolTip Content="{telerik:LocalizableResource Key=Diagram_Resize}"/>
                            </ToolTipService.ToolTip>
                        </Rectangle>
                        <Rectangle x:Name="BottomRightResizeHandle"
                                Style="{StaticResource ResizingRectangleStyle}"
                                Margin="{StaticResource ManipulationAdornerThicknessB}"
                                VerticalAlignment="Bottom"
                                HorizontalAlignment="Right">
                            <ToolTipService.ToolTip>
                                <ToolTip Content="{telerik:LocalizableResource Key=Diagram_Resize}"/>
                            </ToolTipService.ToolTip>
                        </Rectangle>
                        <Path x:Name="RotationPart"
                                Margin="0 -30 0 0"
                                Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsRotationEnabled, Converter={StaticResource converter}}"
                                Data="M13,0L13,7.5L5.8,5.6L8.3,3.7C7.8,3.2 7,3 6.5,3C4.6,3 3,4.7 3,6.6C3,8.6 4.6,10 6.5,10C7.9,9.9 8.8,9.5 9.4,8.6L12.3,9.6C11,11.7 9,13 6.5,13C3,13 0,10 0,6.6C0,3 3,0 6.5,0C8.4375,0 9.7,0.8 10.8,1.7z"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"
                                Stroke="{StaticResource DiagramControl_RotationPath_Stroke}"
                                Height="{StaticResource ManipulationAdornerHeight}"
                                Stretch="Fill"
                                Width="{StaticResource ManipulationAdornerWidth}"
                                Fill="{StaticResource DiagramControl_RotationPath_Fill}">
                            <ToolTipService.ToolTip>
                                <ToolTip Content="{telerik:LocalizableResource Key=Diagram_Rotate}"/>
                            </ToolTipService.ToolTip>
                        </Path>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="primitives:ConnectionManipulationAdorner" x:Key="ConnectionManipulationAdornerStyle">
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="primitives:ConnectionManipulationAdorner">
                    <Grid>
                        <Canvas VerticalAlignment="Top" HorizontalAlignment="Left">
                            <Path Stroke="{StaticResource DiagramControl_ConnectionAdorner_BorderBrush}" StrokeThickness="1" StrokeDashArray="3 3">
                                <Path.Data>
                                    <PathGeometry>
                                        <PathGeometry.Figures>
                                            <PathFigureCollection>
                                                <PathFigure StartPoint="{Binding StartPoint, RelativeSource={RelativeSource TemplatedParent}}">
                                                    <PathFigure.Segments>
                                                        <PathSegmentCollection>
                                                            <LineSegment Point="{Binding StartBezierPoint, RelativeSource={RelativeSource TemplatedParent}}"/>
                                                        </PathSegmentCollection>
                                                    </PathFigure.Segments>
                                                </PathFigure>
                                            </PathFigureCollection>
                                        </PathGeometry.Figures>
                                    </PathGeometry>
                                </Path.Data>
                            </Path>
                            <Path Stroke="{StaticResource DiagramControl_ConnectionAdorner_BorderBrush}" StrokeThickness="1" StrokeDashArray="3 3">
                                <Path.Data>
                                    <PathGeometry>
                                        <PathGeometry.Figures>
                                            <PathFigureCollection>
                                                <PathFigure StartPoint="{Binding EndPoint, RelativeSource={RelativeSource TemplatedParent}}">
                                                    <PathFigure.Segments>
                                                        <PathSegmentCollection>
                                                            <LineSegment Point="{Binding EndBezierPoint, RelativeSource={RelativeSource TemplatedParent}}"/>
                                                        </PathSegmentCollection>
                                                    </PathFigure.Segments>
                                                </PathFigure>
                                            </PathFigureCollection>
                                        </PathGeometry.Figures>
                                    </PathGeometry>
                                </Path.Data>
                            </Path>
                        </Canvas>
                        <Canvas x:Name="ConnectionManipulationPointsSurface"
                                VerticalAlignment="Top"
                                HorizontalAlignment="Left"
                                Visibility="{Binding Path=IsConnectionAdornerActive, Converter={StaticResource converter},RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="primitives:DrawingAdorner" x:Key="DrawingAdornerStyle">
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="primitives:DrawingAdorner">
                    <Grid>
                        <Canvas>
                            <Path x:Name="StartHandlesPathControl" Stroke="{StaticResource DiagramControl_ConnectionAdorner_BorderBrush}" StrokeDashArray="3 1" StrokeThickness="1"/>
                            <Path x:Name="EndHandlesPathControl" Stroke="{StaticResource DiagramControl_ConnectionAdorner_BorderBrush}" StrokeDashArray="3 1" StrokeThickness="1"/>
                        </Canvas>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="primitives:GroupsAdorner" x:Key="GroupsAdornerStyle">
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <Canvas/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="primitives:GroupsAdorner">
                    <ItemsPresenter/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="primitives:ItemInformationAdorner" x:Key="ItemInformationAdornerStyle">
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="{StaticResource DiagramControl_TipPanel_BorderBrush}"/>
        <Setter Property="Background" Value="{StaticResource DiagramControl_TipPanel_Background}"/>
        <Setter Property="Foreground" Value="{StaticResource DiagramControl_TipPanel_Foreground}"/>
        <Setter Property="InformationTipTemplateSelector" Value="{StaticResource informationTemplateSelector}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="primitives:ItemInformationAdorner">
                    <Grid>
                        <Canvas x:Name="InformationTipPanel" Visibility="Collapsed" HorizontalAlignment="Left" VerticalAlignment="Bottom">
                            <Grid Canvas.Top="10">
                                <Border
                                        Background="{TemplateBinding Background}"
                                        BorderBrush="{TemplateBinding BorderBrush}"
                                        BorderThickness="{TemplateBinding BorderThickness}"
                                        CornerRadius="{StaticResource DiagramControl_TipPanel_CornerRadius}"/>
                                <ContentPresenter x:Name="InformationTipPresenter" ContentTemplate="{StaticResource PositionTipTemplate}"/>
                            </Grid>
                        </Canvas>
                        <ContentPresenter x:Name="AdditionalContentPresenter" Visibility="{Binding IsAdditionalContentVisible, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource converter}}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="primitives:ConnectionEditPointControl" x:Key="ConnectionEditPointControlStyle">
        <Setter Property="Width" Value="{StaticResource DiagramConnectorWidth}"/>
        <Setter Property="Height" Value="{StaticResource DiagramConnectorHeight}"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="{StaticResource DiagramControl_ShapeManipulation_BorderBrush}"/>
        <Setter Property="Background" Value="{StaticResource DiagramControl_ShapeManipulation_Background}"/>
        <Setter Property="Cursor" Value="ScrollAll"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="primitives:ConnectionEditPointControl">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="MouseStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DisplayElement" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DiagramControl_ShapeManipulation_MouseOver_Background}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DisplayElement" Storyboard.TargetProperty="Stroke">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DiagramControl_ShapeManipulation_MouseOver_BorderBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="PointTypeStates">
                                <VisualState x:Name="Intermediate"/>
                                <VisualState x:Name="First"/>
                                <VisualState x:Name="Last"/>
                                <VisualState x:Name="SegmentHandle"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ConnectionStates">
                                <VisualState x:Name="Disconnected"/>
                                <VisualState x:Name="ConnectedSource">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DisplayElement" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DisplayElementSelect" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DisplayElementSelect" Storyboard.TargetProperty="Stroke">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DiagramControl_ShapeManipulation_Selected_BorderBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ConnectedTarget">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DisplayElement" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DisplayElementSelect" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DisplayElementSelect" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DiagramControl_ShapeManipulation_Selected_Background}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DisplayElementSelect" Storyboard.TargetProperty="Stroke">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DiagramControl_ShapeManipulation_Selected_BorderBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ManipulationStates">
                                <VisualState x:Name="NotManipulating"/>
                                <VisualState x:Name="Manipulating">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="manipulationCross" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DisplayElement" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid>
                            <Ellipse x:Name="DisplayElement"
                                    HorizontalAlignment="Stretch"
                                    VerticalAlignment="Stretch"
                                    Fill="{TemplateBinding Background}"
                                    StrokeThickness="{TemplateBinding BorderThickness}"
                                    Stroke="{TemplateBinding BorderBrush}"
                                    RenderTransformOrigin="0.5, 0.5">
                                <Ellipse.RenderTransform>
                                    <RotateTransform x:Name="rotation"/>
                                </Ellipse.RenderTransform>
                            </Ellipse>
                            <Ellipse x:Name="DisplayElementSelect"
                                    Visibility="Collapsed"
                                    HorizontalAlignment="Stretch"
                                    VerticalAlignment="Stretch"
                                    Fill="{TemplateBinding Background}"
                                    StrokeThickness="{TemplateBinding BorderThickness}"
                                    Stroke="{TemplateBinding BorderBrush}"
                                    RenderTransformOrigin="0.5, 0.5"
                                    RenderTransform="{Binding Path=RenderTransform, ElementName= DisplayElement}"/>
                            <Grid HorizontalAlignment="Center" Height="9" Margin="0 0 1 1" VerticalAlignment="Center" Width="9" x:Name="manipulationCross" Visibility="Collapsed">
                                <Path
                                        Data="M3,0 L4,0 L5,0 L6,0 L6,2.5 L6,2.57 C6.23,2.69 6.36,2.81 6.47,3 L6.5,3 L9,3 L9,4 L9,5 L9,6 L8,6 L6.5,6 L6.5,6 C6.36,6.19 6.23,6.31 6,6.43 L6,6.5 L6,8 L6,9 L3,9 L3,8 L3,6.5 L3,6.43C2.77,6.31 2.64,6.19 2.53,6 L2.5,6 L1,6 L1.34E-07,6 L0,5 L0,4 L1.34E-07,3 L2.5,3 L2.53,3 C2.6,2.8 2.77,2.7 3,2.57 L3,2.5 z"
                                        Fill="White"
                                        Stretch="Fill"
                                        UseLayoutRounding="False"/>
                                <Path
                                        Data="M3.5,3 C3.2,3 3,3.2 3,3.5 L3,3.5 L3,3.5 C3,3.8 3.2,4 3.5,4 L3.5,4 L3.5,4 C3.79,4 4,3.77 4,3.5 C4,3.22 3.8,3 3.5,3 z M3,0 L4,0 L4,2 L4,2 C4.5,2.24 4.76,2.57 4.91,2.99 L4.9,3 L7,3 L7,4 L4.91,4 L4.91,4 C4.78,4.43 4.43,4.76 4,4.91 L4,4.91 L4,7 L3,7 L3,4.91 L3,4.91 C2.57,4.76 2.24,4.43 2.09,4.02 L2.09,4 L0,4 L0,3 L2.09,3 L2.09,3 C2.24,2.57 2.57,2.24 3,2.09 L3,2.09 z"
                                        Fill="Black"
                                        Margin="1"
                                        Stretch="Fill"
                                        UseLayoutRounding="False"/>
                            </Grid>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="primitives:AlignmentAdorner" x:Key="AlignmentAdornerStyle">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="primitives:AlignmentAdorner">
                    <Canvas x:Name="RootPanel"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="primitives:GraphPaper" x:Key="GraphPaperStyle">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="primitives:GraphPaper">
                    <Canvas x:Name="LinesPanel"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="BackgroundGridStyle" TargetType="primitives:BackgroundGrid">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="primitives:BackgroundGrid">
                    <Canvas x:Name="LinesPanel"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="BackgroundPageGridStyle" TargetType="primitives:BackgroundPageGrid">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="primitives:BackgroundPageGrid">
                    <Canvas x:Name="LinesPanel"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="diagrams:RadDiagramConnector" x:Key="RadDiagramConnectorStyle">
        <Setter Property="Width" Value="{StaticResource DiagramConnectorWidth}"/>
        <Setter Property="Height" Value="{StaticResource DiagramConnectorHeight}"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="BorderThickness" Value="{StaticResource DiagramConnectorThickness}"/>
        <Setter Property="BorderBrush" Value="{StaticResource DiagramControl_Connector_BorderBrush}"/>
        <Setter Property="Background" Value="{StaticResource DiagramControl_Connector_Background}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="diagrams:RadDiagramConnector">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="MouseStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="OverElement" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="OverElement" Storyboard.TargetProperty="Stroke">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DiagramControl_ShapeManipulation_MouseOver_BorderBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="OverElement" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DiagramControl_ShapeManipulation_MouseOver_Background}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ActiveStates">
                                <VisualState x:Name="Inactive"/>
                                <VisualState x:Name="Active">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DisplayElement" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="OverElement" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="OverElement" Storyboard.TargetProperty="Stroke">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DiagramControl_ShapeManipulation_Selected_BorderBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="OverElement" Storyboard.TargetProperty="StrokeThickness">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Double>2</sys:Double>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="OverElement" Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>-2</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid>
                            <Ellipse x:Name="DisplayElement" Fill="{TemplateBinding Background}" StrokeThickness="{TemplateBinding BorderThickness}" Stroke="{TemplateBinding BorderBrush}"/>
                            <Ellipse x:Name="OverElement" Visibility="Collapsed" Fill="{TemplateBinding Background}" StrokeThickness="{TemplateBinding BorderThickness}"/>
                            <ToolTipService.ToolTip>
                                <ToolTip Content="{telerik:LocalizableResource Key=Diagram_Connector}"/>
                            </ToolTipService.ToolTip>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="primitives:ConnectorsControl" BasedOn="{StaticResource ConnectorsControlStyle}"/>
    <Style TargetType="primitives:AlignmentAdorner" BasedOn="{StaticResource AlignmentAdornerStyle}"/>
    <Style TargetType="primitives:GraphPaper" BasedOn="{StaticResource GraphPaperStyle}"/>
    <Style TargetType="primitives:BackgroundGrid" BasedOn="{StaticResource BackgroundGridStyle}"/>
    <Style TargetType="primitives:BackgroundPageGrid" BasedOn="{StaticResource BackgroundPageGridStyle}"/>
    <Style TargetType="diagrams:RadDiagramConnector" BasedOn="{StaticResource RadDiagramConnectorStyle}"/>
    <Style TargetType="primitives:ConnectionEditPointControl" BasedOn="{StaticResource ConnectionEditPointControlStyle}"/>
    <Style TargetType="primitives:ItemInformationAdorner" BasedOn="{StaticResource ItemInformationAdornerStyle}"/>
    <Style TargetType="primitives:ConnectionManipulationAdorner" BasedOn="{StaticResource ConnectionManipulationAdornerStyle}"/>
    <Style TargetType="primitives:GroupsAdorner" BasedOn="{StaticResource GroupsAdornerStyle}"/>
    <Style TargetType="primitives:DrawingAdorner" BasedOn="{StaticResource DrawingAdornerStyle}"/>
    <Style TargetType="primitives:ManipulationAdorner" BasedOn="{StaticResource ManipulationAdornerStyle}"/>
    <telerik:BooleanToVisibilityConverter x:Key="booleanConverter"/>
    <sys:Int32 x:Key="containerZIndex">0</sys:Int32>
    <sys:Int32 x:Key="connectionZIndex">1</sys:Int32>
    <sys:Int32 x:Key="shapeZIndex">2</sys:Int32>
    <Style TargetType="TextBox" x:Key="EditTextBoxStyle">
        <Setter Property="TextWrapping" Value="Wrap"/>
        <Setter Property="AcceptsReturn" Value="True"/>
        <Setter Property="TextAlignment" Value="Center"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="Margin" Value="4"/>
        <Setter Property="FontSize" Value="11"/>
        <Setter Property="FontFamily" Value="Segoe UI"/>
        <Setter Property="Foreground" Value="Black"/>
        <Setter Property="Padding" Value="2"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="TextBox">
                    <Grid x:Name="RootElement" UseLayoutRounding="True">
                        <Rectangle Stroke="{StaticResource DiagramShape_EditTextBox_BorderBrush}" StrokeDashArray="3 3" Fill="{StaticResource DiagramShape_EditTextBox_Background}"/>
                        <ScrollViewer
                                Padding="{TemplateBinding Padding}"
                                BorderThickness="0"
                                Background="Transparent"
                                Foreground="{TemplateBinding Foreground}"
                                VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                x:Name="PART_ContentHost"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="diagramscontrols:RadDiagramConnection" x:Key="RadDiagramConnectionStyle">
        <Setter Property="Background" Value="{StaticResource DiagramShape_Connection_Background}"/>
        <Setter Property="Stroke" Value="{StaticResource DiagramShape_Connection_BorderBrush}"/>
        <Setter Property="StrokeThickness" Value="1"/>
        <Setter Property="ZIndex" Value="{StaticResource connectionZIndex}"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="diagramscontrols:RadDiagramConnection">
                    <Grid x:Name="RootTemplate">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Selected"/>
                                <VisualState x:Name="SelectedInGroup">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SelectedInGroupPath" Storyboard.TargetProperty="Visibility" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unselected"/>
                                <VisualState x:Name="SelectedAsGroup"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="EditMode">
                                <VisualState x:Name="NormalMode"/>
                                <VisualState x:Name="NormalEditMode">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="NormalContent" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="EditContent" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="TextBoxEditMode">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="NormalContent" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="EditTextBox" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Path x:Name="DeferredPath"
                                Stroke="{TemplateBinding Stroke}"
                                Opacity="0.7"
                                Fill="{TemplateBinding Background}"
                                StrokeThickness="{TemplateBinding StrokeThickness}"
                                StrokeDashArray="2 2"/>
                        <Path x:Name="SelectedInGroupPath" Visibility="Collapsed" Stroke="{StaticResource DiagramShape_Selected_BorderBrush}"/>
                        <Path
                                Stroke="{TemplateBinding Stroke}"
                                Fill="{TemplateBinding Background}"
                                StrokeThickness="{TemplateBinding StrokeThickness}"
                                x:Name="GeometryPath"
                                StrokeDashArray="{TemplateBinding StrokeDashArray}"/>
                        <Canvas>
                            <Grid x:Name="EdittingElement">
                                <Border Background="#00FFFFFF"/>
                                <ContentPresenter x:Name="NormalContent"/>
                                <ContentPresenter x:Name="EditContent" Visibility="Collapsed" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding EditTemplate}"/>
                                <TextBox x:Name="EditTextBox" Visibility="Collapsed" Style="{StaticResource EditTextBoxStyle}">
                                    <TextBox.InputBindings>
                                        <KeyBinding Key="Enter" Command="ApplicationCommands.NotACommand"/>
                                    </TextBox.InputBindings>
                                </TextBox>
                            </Grid>
                        </Canvas>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="diagramscontrols:RadDiagramShape" x:Key="RadDiagramShapeStyle">
        <Setter Property="Foreground" Value="{StaticResource DiagramShape_Foreground}"/>
        <Setter Property="Background" Value="{StaticResource DiagramShape_Background}"/>
        <Setter Property="BorderBrush" Value="{StaticResource DiagramShape_BorderBrush}"/>
        <Setter Property="FontSize" Value="{StaticResource DiagramShapeFontSize}"/>
        <Setter Property="ZIndex" Value="{StaticResource shapeZIndex}"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="RenderTransformOrigin" Value="0.5 0.5"/>
        <Setter Property="diagrams:DiagramBehaviors.TextWrapping" Value="Wrap"/>
        <Setter Property="StrokeThickness" Value="1"/>
        <Setter Property="Padding" Value="4"/>
        <Setter Property="StrokeDashArray" Value="1 0"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Geometry" Value="M 0,0 H 60 V40 H 0 Z"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="diagramscontrols:RadDiagramShape">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="MouseStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ActiveConectionStates">
                                <VisualState x:Name="NormalActiveConnectionState"/>
                                <VisualState x:Name="ActiveConnectionInsideShape">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ActiveSelectedBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ConnectorsAdornerVisibilityStates">
                                <VisualState x:Name="ConnectorsAdornerCollapsed"/>
                                <VisualState x:Name="ConnectorsAdornerVisible">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ConnectorsControl" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Selected"/>
                                <VisualState x:Name="SelectedInGroup">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="SelectedInGroupBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unselected"/>
                                <VisualState x:Name="SelectedAsGroup"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="EditMode">
                                <VisualState x:Name="NormalMode"/>
                                <VisualState x:Name="NormalEditMode">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="NormalContent" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="EditContent" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="TextBoxEditMode">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="NormalContent" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="EditTextBox" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid>
                            <Path x:Name="Geometry"
                                    Fill="{TemplateBinding Background}"
                                    Stroke="{TemplateBinding BorderBrush}"
                                    Opacity="{TemplateBinding Opacity}"
                                    Stretch="Fill"
                                    StrokeThickness="{TemplateBinding StrokeThickness}"
                                    Data="{TemplateBinding Geometry}"
                                    StrokeDashArray="{TemplateBinding StrokeDashArray}"/>
                            <Border x:Name="SelectedInGroupBorder" Visibility="Collapsed" BorderBrush="{StaticResource DiagramShape_Selected_BorderBrush}" BorderThickness="2"/>
                            <Border x:Name="ActiveSelectedBorder" Visibility="Collapsed" BorderBrush="{StaticResource DiagramShape_ActiveSelected_BorderBrush}" BorderThickness="2"/>
                            <ContentPresenter x:Name="NormalContent"
                                    Margin="{TemplateBinding Padding}"
                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                            <primitives:ConnectorsControl x:Name="ConnectorsControl" ItemsSource="{TemplateBinding Connectors}" Visibility="Collapsed" ItemContainerStyle="{TemplateBinding ConnectorStyle}"/>
                        </Grid>
                        <Grid x:Name="PART_RotationalPart">
                            <ContentPresenter x:Name="EditContent"
                                    Visibility="Collapsed"
                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                    Content="{TemplateBinding Content}"
                                    ContentTemplate="{TemplateBinding EditTemplate}"/>
                            <TextBox x:Name="EditTextBox" Style="{StaticResource EditTextBoxStyle}" Visibility="Collapsed">
                                <TextBox.InputBindings>
                                    <KeyBinding Key="Enter" Command="ApplicationCommands.NotACommand"/>
                                </TextBox.InputBindings>
                            </TextBox>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="diagramscontrols:RadDiagramContainerShape" x:Key="RadDiagramContainerShapeStyle">
        <Setter Property="Background" Value="{StaticResource DiagramContainerShape_Background}"/>
        <Setter Property="BorderBrush" Value="{StaticResource DiagramContainerShape_BorderBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="RenderTransformOrigin" Value="0.5 0.5"/>
        <Setter Property="diagrams:DiagramBehaviors.TextWrapping" Value="Wrap"/>
        <Setter Property="FontFamily" Value="Segoe UI"/>
        <Setter Property="FontSize" Value="{StaticResource DiagramContainerShapeFontSize}"/>
        <Setter Property="Foreground" Value="{StaticResource DiagramContainerShapeForeground}"/>
        <Setter Property="ZIndex" Value="{StaticResource containerZIndex}"/>
        <Setter Property="MinWidth" Value="200"/>
        <Setter Property="MinHeight" Value="100"/>
        <Setter Property="CollapsedContent" Value="Collapsed Container"/>
        <Setter Property="Padding" Value="{StaticResource DiagramContainerShapePadding}"/>
        <Setter Property="Content" Value="Header"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="diagramscontrols:RadDiagramContainerShape">
                    <Grid x:Name="RootPanel">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="MouseStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CollapsedStates">
                                <VisualState x:Name="Expanded"/>
                                <VisualState x:Name="Collapsed"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ActiveConectionStates">
                                <VisualState x:Name="NormalActiveConnectionState"/>
                                <VisualState x:Name="ActiveConnectionInsideShape">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ActiveSelectedBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ConnectorsAdornerVisibilityStates">
                                <VisualState x:Name="ConnectorsAdornerCollapsed"/>
                                <VisualState x:Name="ConnectorsAdornerVisible">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ConnectorsControl" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Selected"/>
                                <VisualState x:Name="SelectedInGroup">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="SelectedInGroupBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unselected"/>
                                <VisualState x:Name="SelectedAsGroup"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="EditMode">
                                <VisualState x:Name="NormalMode"/>
                                <VisualState x:Name="NormalEditMode">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="NormalContent" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="EditContent" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="TextBoxEditMode">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="NormalContent" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="EditTextBox" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="DropStates">
                                <VisualState x:Name="DropNormal"/>
                                <VisualState x:Name="DropComplete"/>
                                <VisualState x:Name="DragOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DragOverBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Border x:Name="ContainerBorder"
                                Grid.RowSpan="3"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                Background="{TemplateBinding Background}"/>
                        <Border x:Name="SelectedInGroupBorder" Visibility="Collapsed" Grid.RowSpan="3" BorderBrush="{StaticResource DiagramShape_Selected_BorderBrush}" BorderThickness="2"/>
                        <Border x:Name="DragOverBorder"
                                Visibility="Collapsed"
                                Grid.RowSpan="3"
                                BorderBrush="{StaticResource DiagramShape_ActiveSelected_BorderBrush}"
                                BorderThickness="4"
                                Margin="-4"/>
                        <Border x:Name="ActiveSelectedBorder"
                                Visibility="Collapsed"
                                Grid.RowSpan="3"
                                BorderBrush="{StaticResource DiagramShape_ActiveSelected_BorderBrush}"
                                BorderThickness="3"
                                Opacity="0.3"/>
                        <Grid MinHeight="26">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <ContentPresenter x:Name="NormalContent"
                                    Margin="{TemplateBinding Padding}"
                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                            <Grid x:Name="PART_RotationalPart">
                                <ContentPresenter x:Name="EditContent"
                                        Visibility="Collapsed"
                                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                        Content="{TemplateBinding Content}"
                                        ContentTemplate="{TemplateBinding EditTemplate}"/>
                                <TextBox x:Name="EditTextBox" Style="{StaticResource EditTextBoxStyle}" Visibility="Collapsed" Margin="4 4 4 3">
                                    <TextBox.InputBindings>
                                        <KeyBinding Key="Enter" Command="ApplicationCommands.NotACommand"/>
                                    </TextBox.InputBindings>
                                </TextBox>
                            </Grid>
                            <telerik:RadToggleButton x:Name="ToggleCollapseButton"
                                    Grid.Column="1"
                                    Padding="3"
                                    VerticalAlignment="Center"
                                    IsTabStop="False"
                                    IsBackgroundVisible="False"
                                    Visibility="{Binding IsCollapsible, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource booleanConverter}}"
                                    Margin="3 4 4 4"
                                    Width="18"
                                    MinHeight="18"
                                    Focusable="False">
                                <primitives:ToggleButtonExtensions.CheckedContent>
                                    <Path Data="M0,0 L1,0 L4,3 L7,0 L8,0 L4,4 z" Fill="{StaticResource DiagramContainerShape_Collapsed_Fill}"/>
                                </primitives:ToggleButtonExtensions.CheckedContent>
                                <primitives:ToggleButtonExtensions.UncheckedContent>
                                    <Path Data="M4,0 L8,4 L7,4 L4,1 L1,4 L0,4 z" Fill="{StaticResource DiagramContainerShape_Collapsed_Fill}"/>
                                </primitives:ToggleButtonExtensions.UncheckedContent>
                            </telerik:RadToggleButton>
                        </Grid>
                        <Border x:Name="InnerContainerBorder" Grid.Row="1" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0 1 0 0"/>
                        <ContentControl x:Name="CollapsedContent"
                                Content="{TemplateBinding CollapsedContent}"
                                Foreground="{TemplateBinding Foreground}"
                                Grid.Row="1"
                                ContentTemplate="{TemplateBinding CollapsedContentTemplate}"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                Visibility="{Binding IsCollapsed, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource booleanConverter}}"/>
                        <primitives:ConnectorsControl x:Name="ConnectorsControl" Grid.RowSpan="3" ItemsSource="{TemplateBinding Connectors}" Visibility="Collapsed" ItemContainerStyle="{TemplateBinding ConnectorStyle}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="diagramscontrols:RadDiagramTextShape" x:Key="RadDiagramTextShapeStyle">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="RenderTransformOrigin" Value="0.5 0.5"/>
        <Setter Property="FontSize" Value="{StaticResource DiagramShapeFontSize}"/>
        <Setter Property="FontFamily" Value="Segoe UI"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="diagrams:DiagramBehaviors.TextWrapping" Value="Wrap"/>
        <Setter Property="ZIndex" Value="2"/>
        <Setter Property="Padding" Value="4"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="diagramscontrols:RadDiagramTextShape">
                    <Grid UseLayoutRounding="True">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="MouseStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ActiveConectionStates">
                                <VisualState x:Name="NormalActiveConnectionState"/>
                                <VisualState x:Name="ActiveConnectionInsideShape">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ActiveSelectedBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ConnectorsAdornerVisibilityStates">
                                <VisualState x:Name="ConnectorsAdornerCollapsed"/>
                                <VisualState x:Name="ConnectorsAdornerVisible">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ConnectorsControl" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Selected"/>
                                <VisualState x:Name="SelectedInGroup">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="SelectedInGroupBorder" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unselected"/>
                                <VisualState x:Name="SelectedAsGroup"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="EditMode">
                                <VisualState x:Name="NormalMode"/>
                                <VisualState x:Name="NormalEditMode">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="NormalContent" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="EditContent" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="TextBoxEditMode">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="NormalContent" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="EditTextBox" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid>
                            <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"/>
                            <Border x:Name="SelectedInGroupBorder" Visibility="Collapsed" BorderBrush="{StaticResource DiagramShape_Selected_BorderBrush}" BorderThickness="2"/>
                            <Border x:Name="ActiveSelectedBorder" Visibility="Collapsed" BorderBrush="{StaticResource DiagramShape_ActiveSelected_BorderBrush}" BorderThickness="2"/>
                            <ContentPresenter x:Name="NormalContent" Margin="{TemplateBinding Padding}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            <primitives:ConnectorsControl x:Name="ConnectorsControl" ItemsSource="{TemplateBinding Connectors}" Visibility="Collapsed" ItemContainerStyle="{TemplateBinding ConnectorStyle}"/>
                        </Grid>
                        <Grid x:Name="PART_RotationalPart" Margin="2">
                            <ContentPresenter x:Name="EditContent"
                                    Visibility="Collapsed"
                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                    Content="{TemplateBinding Content}"
                                    ContentTemplate="{TemplateBinding EditTemplate}"/>
                            <TextBox x:Name="EditTextBox" BorderThickness="0" Margin="0" Style="{StaticResource EditTextBoxStyle}" VerticalAlignment="Stretch" Visibility="Collapsed">
                                <TextBox.InputBindings>
                                    <KeyBinding Key="Enter" Command="ApplicationCommands.NotACommand"/>
                                </TextBox.InputBindings>
                            </TextBox>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="diagramscontrols:RadDiagramShape" BasedOn="{StaticResource RadDiagramShapeStyle}"/>
    <Style TargetType="diagramscontrols:RadDiagramContainerShape" BasedOn="{StaticResource RadDiagramContainerShapeStyle}"/>
    <Style TargetType="diagramscontrols:RadDiagramTextShape" BasedOn="{StaticResource RadDiagramTextShapeStyle}"/>
    <Style TargetType="diagramscontrols:RadDiagramConnection" BasedOn="{StaticResource RadDiagramConnectionStyle}"/>
</ResourceDictionary>
