Skip to content

Commit b2ac1aa

Browse files
WPF-1010536_ConnectorLength_property_removed
1 parent fb38298 commit b2ac1aa

6 files changed

Lines changed: 23 additions & 71 deletions

File tree

Samples/Automatic Layout/Force Directed Tree layout/ForceDirectedTreeCodeBehind/MainWindow.xaml

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -104,32 +104,24 @@
104104
<RowDefinition Height="45" ></RowDefinition>
105105
<RowDefinition Height="45"></RowDefinition>
106106
<RowDefinition Height="45" ></RowDefinition>
107-
<RowDefinition Height="45"></RowDefinition>
108-
<RowDefinition Height="45" ></RowDefinition>
109-
<RowDefinition Height="45"></RowDefinition>
110-
<RowDefinition Height="45" ></RowDefinition>
111-
<RowDefinition Height="45"></RowDefinition>
112-
<RowDefinition Height="45"></RowDefinition>
107+
108+
113109

114110
</Grid.RowDefinitions>
115111

116112
<TextBlock Margin="10,10,0,0" Grid.Row="0" Grid.ColumnSpan="2" Text="Properties" Foreground="#0075C0"
117113
FontWeight="Bold" FontSize="13pt"/>
118114

119-
<TextBlock Margin="10,5,0,0" Grid.Row="1" Grid.Column="0" Text="ConnectorLength" Height="25" VerticalAlignment="Center"/>
120-
<Syncfusion:UpDown MinValue="50" Margin="5,5,0,0" Grid.Row="1" Grid.Column="1" Value="110" ValueChanged="UpDown_ValueChanged" Step="5" MaxValue="200"
121-
/>
122-
123-
<TextBlock Margin="10,5,0,0" Grid.Row="2" Grid.Column="0" Text="Max Iteration" VerticalAlignment="Center" Height="25"/>
124-
<Syncfusion:UpDown MinValue="300" Margin="5,5,0,0" Grid.Row="2" Grid.Column="1" Value="2500" ValueChanged="UpDown_ValueChanged_1" Step="50"
115+
<TextBlock Margin="10,5,0,0" Grid.Row="1" Grid.Column="0" Text="Max Iteration" VerticalAlignment="Center" Height="25"/>
116+
<Syncfusion:UpDown MinValue="300" Margin="5,5,0,0" Grid.Row="1" Grid.Column="1" Value="2500" ValueChanged="UpDown_ValueChanged_1" Step="50"
125117
/>
126118

127-
<TextBlock Margin="10,5,0,0" Grid.Row="3" Grid.Column="0" Text="Repulsion Strength" Height="25" VerticalAlignment="Center"/>
128-
<Syncfusion:UpDown MinValue="10000" Margin="5,5,0,0" Grid.Row="3" Grid.Column="1" Value="25000" ValueChanged="UpDown_ValueChanged_2" Step="200" MaxValue="30000"
119+
<TextBlock Margin="10,5,0,0" Grid.Row="2" Grid.Column="0" Text="Repulsion Strength" Height="25" VerticalAlignment="Center"/>
120+
<Syncfusion:UpDown MinValue="10000" Margin="5,5,0,0" Grid.Row="2" Grid.Column="1" Value="25000" ValueChanged="UpDown_ValueChanged_2" Step="200" MaxValue="30000"
129121
/>
130122

131-
<TextBlock Margin="10,0,0,0" Grid.Row="4" Grid.Column="0" Text="Attraction strength" Height="26" VerticalAlignment="Center"/>
132-
<Syncfusion:UpDown MinValue="0.1" MaxValue="1" Margin="5,5,0,0" Grid.Row="4" Value="0.6" ValueChanged="UpDown_ValueChanged_3" Grid.Column="1" Step="0.1"
123+
<TextBlock Margin="10,0,0,0" Grid.Row="3" Grid.Column="0" Text="Attraction strength" Height="26" VerticalAlignment="Center"/>
124+
<Syncfusion:UpDown MinValue="0.1" MaxValue="1" Margin="5,5,0,0" Grid.Row="3" Value="0.6" ValueChanged="UpDown_ValueChanged_3" Grid.Column="1" Step="0.1"
133125
/>
134126

135127

Samples/Automatic Layout/Force Directed Tree layout/ForceDirectedTreeCodeBehind/MainWindow.xaml.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ public MainWindow()
4949
{
5050
Layout = new ForceDirectedTree()
5151
{
52-
ConnectorLength = 110,
5352
AttractionStrength = 0.6,
5453
RepulsionStrength = 25000,
5554
MaximumIteration = 2500,
@@ -195,13 +194,6 @@ private ConnectorViewModel Edge(string sourceId, string targetId)
195194
// e.g. TargetDecorator = new DecoratorViewModel { Shape = DecoratorShapes.Arrow }
196195
};
197196
}
198-
199-
private void UpDown_ValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
200-
{
201-
if(Diagram.LayoutManager != null)
202-
(Diagram.LayoutManager.Layout as ForceDirectedTree).ConnectorLength = (double)e.NewValue;
203-
}
204-
205197
private void UpDown_ValueChanged_1(DependencyObject d, DependencyPropertyChangedEventArgs e)
206198
{
207199
if (Diagram.LayoutManager != null)

Samples/Automatic Layout/Force Directed Tree layout/ForceDirectedTreeDataSource/MainWindow.xaml

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<Setter Property="UnitWidth" Value="130"/>
4444

4545
</Style>
46-
46+
4747
<!--Style for Connector-->
4848
<Style TargetType="Syncfusion:Connector">
4949
<Setter Property="ConnectorGeometryStyle">
@@ -102,33 +102,22 @@
102102
<RowDefinition Height="35" ></RowDefinition>
103103
<RowDefinition Height="35"></RowDefinition>
104104
<RowDefinition Height="35" ></RowDefinition>
105-
<RowDefinition Height="35"></RowDefinition>
106-
<RowDefinition Height="35" ></RowDefinition>
107-
<RowDefinition Height="75"></RowDefinition>
108-
<RowDefinition Height="35"></RowDefinition>
109-
<RowDefinition Height="35"></RowDefinition>
110-
<RowDefinition Height="35"></RowDefinition>
111-
112105

113106
</Grid.RowDefinitions>
114107

115108
<TextBlock Margin="10,10,0,0" Grid.Row="0" Grid.ColumnSpan="2" Text="Properties" Foreground="#0075C0"
116109
FontWeight="Bold" FontSize="13pt"/>
117110

118-
<TextBlock Margin="10,5,0,0" Grid.Row="1" Grid.Column="0" Text="ConnectorLength" Height="25" VerticalAlignment="Center"/>
119-
<Syncfusion:UpDown x:Name="connectorlength" MinValue="100" Margin="5,5,0,0" Grid.Row="1" Grid.Column="1" Step="5" MaxValue="170"
120-
Value="{Binding ConnectorLength, Mode=TwoWay}" />
121-
122-
<TextBlock Margin="10,5,0,0" Grid.Row="2" Grid.Column="0" Text="Max Iteration" VerticalAlignment="Center" Height="25"/>
123-
<Syncfusion:UpDown x:Name="maxiteration" MinValue="300" Margin="5,5,0,0" Grid.Row="2" Grid.Column="1" Step="50"
111+
<TextBlock Margin="10,5,0,0" Grid.Row="1" Grid.Column="0" Text="Max Iteration" VerticalAlignment="Center" Height="25"/>
112+
<Syncfusion:UpDown x:Name="maxiteration" MinValue="300" Margin="5,5,0,0" Grid.Row="1" Grid.Column="1" Step="50"
124113
Value="{Binding MaximumIteration, Mode=TwoWay}"/>
125114

126-
<TextBlock Margin="10,5,0,0" Grid.Row="3" Grid.Column="0" Text="Repulsion Strength" Height="25" VerticalAlignment="Center"/>
127-
<Syncfusion:UpDown x:Name="repulsionstrength" MinValue="25000" Margin="5,5,0,0" Grid.Row="3" Grid.Column="1" Step="250" MaxValue="30000"
115+
<TextBlock Margin="10,5,0,0" Grid.Row="2" Grid.Column="0" Text="Repulsion Strength" Height="25" VerticalAlignment="Center"/>
116+
<Syncfusion:UpDown x:Name="repulsionstrength" MinValue="25000" Margin="5,5,0,0" Grid.Row="2" Grid.Column="1" Step="250" MaxValue="30000"
128117
Value="{Binding RepulsionStrength, Mode=TwoWay}" />
129118

130-
<TextBlock Margin="10,0,0,0" Grid.Row="4" Grid.Column="0" Text="Attraction strength" Height="26" VerticalAlignment="Center"/>
131-
<Syncfusion:UpDown x:Name="attractionstrength" MinValue="0.1" MaxValue="1" Margin="5,5,0,0" Grid.Row="4" Grid.Column="1" Step="0.1"
119+
<TextBlock Grid.Row="3" Grid.Column="0" Text="Attraction strength" Height="26" VerticalAlignment="Center" HorizontalAlignment="Right" Width="120"/>
120+
<Syncfusion:UpDown x:Name="attractionstrength" MinValue="0.1" MaxValue="1" Margin="5,5,0,0" Grid.Row="3" Grid.Column="1" Step="0.1"
132121
Value="{Binding AttractionStrength, Mode=TwoWay}" />
133122

134123
</Grid>

Samples/Automatic Layout/Force Directed Tree layout/ForceDirectedTreeDataSource/ViewModel/ForceDirectedViewModel.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ public ForceDirectedViewModel()
138138
{
139139
Layout = new ForceDirectedTree()
140140
{
141-
ConnectorLength = 110,
142141
AttractionStrength = 0.6,
143142
RepulsionStrength = 25000,
144143
MaximumIteration = 1000,

Samples/Automatic Layout/Force Directed Tree layout/ForceDirectedTreeView/MainWindow.xaml

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@
472472
<syncfusion:SfDiagram.LayoutManager>
473473
<syncfusion:LayoutManager>
474474
<syncfusion:LayoutManager.Layout>
475-
<syncfusion:ForceDirectedTree ConnectorLength="110"
475+
<syncfusion:ForceDirectedTree
476476
AttractionStrength="0.6"
477477
RepulsionStrength="25000"
478478
MaximumIteration="2500" />
@@ -493,32 +493,23 @@
493493
<RowDefinition Height="45" ></RowDefinition>
494494
<RowDefinition Height="45"></RowDefinition>
495495
<RowDefinition Height="45" ></RowDefinition>
496-
<RowDefinition Height="45"></RowDefinition>
497-
<RowDefinition Height="45" ></RowDefinition>
498-
<RowDefinition Height="45"></RowDefinition>
499-
<RowDefinition Height="45" ></RowDefinition>
500-
<RowDefinition Height="45"></RowDefinition>
501-
<RowDefinition Height="45"></RowDefinition>
496+
502497

503498
</Grid.RowDefinitions>
504499

505500
<TextBlock Margin="10,10,0,0" Grid.Row="0" Grid.ColumnSpan="2" Text="Properties" Foreground="#0075C0"
506501
FontWeight="Bold" FontSize="13pt"/>
507502

508-
<TextBlock Margin="10,5,0,0" Grid.Row="1" Grid.Column="0" Text="ConnectorLength" Height="25" VerticalAlignment="Center"/>
509-
<syncfusion:UpDown MinValue="50" Margin="5,5,0,0" Grid.Row="1" Grid.Column="1" Value="150" ValueChanged="UpDown_ValueChanged" Step="5" MaxValue="200"
510-
/>
511-
512-
<TextBlock Margin="10,5,0,0" Grid.Row="2" Grid.Column="0" Text="Max Iteration" VerticalAlignment="Center" Height="25"/>
513-
<syncfusion:UpDown MinValue="300" Margin="5,5,0,0" Grid.Row="2" Grid.Column="1" Value="2500" ValueChanged="UpDown_ValueChanged_1" Step="50"
503+
<TextBlock Margin="10,5,0,0" Grid.Row="1" Grid.Column="0" Text="Max Iteration" VerticalAlignment="Center" Height="25"/>
504+
<syncfusion:UpDown MinValue="300" Margin="5,5,0,0" Grid.Row="1" Grid.Column="1" Value="2500" ValueChanged="UpDown_ValueChanged_1" Step="50"
514505
/>
515506

516-
<TextBlock Margin="10,5,0,0" Grid.Row="3" Grid.Column="0" Text="Repulsion Strength" Height="25" VerticalAlignment="Center"/>
517-
<syncfusion:UpDown MinValue="10000" Margin="5,5,0,0" Grid.Row="3" Grid.Column="1" Value="25000" ValueChanged="UpDown_ValueChanged_2" Step="200" MaxValue="30000"
507+
<TextBlock Margin="10,5,0,0" Grid.Row="2" Grid.Column="0" Text="Repulsion Strength" Height="25" VerticalAlignment="Center"/>
508+
<syncfusion:UpDown MinValue="10000" Margin="5,5,0,0" Grid.Row="2" Grid.Column="1" Value="25000" ValueChanged="UpDown_ValueChanged_2" Step="200" MaxValue="30000"
518509
/>
519510

520-
<TextBlock Margin="10,0,0,0" Grid.Row="4" Grid.Column="0" Text="Attraction strength" Height="26" VerticalAlignment="Center"/>
521-
<syncfusion:UpDown MinValue="0.1" MaxValue="1" Margin="5,5,0,0" Grid.Row="4" Value="0.6" ValueChanged="UpDown_ValueChanged_3" Grid.Column="1" Step="0.1"
511+
<TextBlock Margin="10,0,0,0" Grid.Row="3" Grid.Column="0" Text="Attraction strength" Height="26" VerticalAlignment="Center"/>
512+
<syncfusion:UpDown MinValue="0.1" MaxValue="1" Margin="5,5,0,0" Grid.Row="3" Value="0.6" ValueChanged="UpDown_ValueChanged_3" Grid.Column="1" Step="0.1"
522513
/>
523514

524515

Samples/Automatic Layout/Force Directed Tree layout/ForceDirectedTreeView/MainWindow.xaml.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,6 @@ private void Diagram_Loaded(object sender, RoutedEventArgs e)
4545
(Diagram.Info as IGraphInfo).Commands.FitToPage.Execute(null);
4646
temp = true;
4747
}
48-
49-
private void UpDown_ValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
50-
{
51-
if (temp)
52-
{
53-
if ((Diagram.LayoutManager.Layout as ForceDirectedTree).ConnectorLength != (double)e.NewValue)
54-
(Diagram.LayoutManager.Layout as ForceDirectedTree).ConnectorLength = (double)e.NewValue;
55-
temp = true;
56-
}
57-
}
58-
5948
private void UpDown_ValueChanged_1(DependencyObject d, DependencyPropertyChangedEventArgs e)
6049
{
6150
if (temp)

0 commit comments

Comments
 (0)