Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,32 +104,24 @@
<RowDefinition Height="45" ></RowDefinition>
<RowDefinition Height="45"></RowDefinition>
<RowDefinition Height="45" ></RowDefinition>
<RowDefinition Height="45"></RowDefinition>
<RowDefinition Height="45" ></RowDefinition>
<RowDefinition Height="45"></RowDefinition>
<RowDefinition Height="45" ></RowDefinition>
<RowDefinition Height="45"></RowDefinition>
<RowDefinition Height="45"></RowDefinition>



</Grid.RowDefinitions>

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

<TextBlock Margin="10,5,0,0" Grid.Row="1" Grid.Column="0" Text="ConnectorLength" Height="25" VerticalAlignment="Center"/>
<Syncfusion:UpDown MinValue="50" Margin="5,5,0,0" Grid.Row="1" Grid.Column="1" Value="110" ValueChanged="UpDown_ValueChanged" Step="5" MaxValue="200"
/>

<TextBlock Margin="10,5,0,0" Grid.Row="2" Grid.Column="0" Text="Max Iteration" VerticalAlignment="Center" Height="25"/>
<Syncfusion:UpDown MinValue="300" Margin="5,5,0,0" Grid.Row="2" Grid.Column="1" Value="2500" ValueChanged="UpDown_ValueChanged_1" Step="50"
<TextBlock Margin="10,5,0,0" Grid.Row="1" Grid.Column="0" Text="Max Iteration" VerticalAlignment="Center" Height="25"/>
<Syncfusion:UpDown MinValue="300" Margin="5,5,0,0" Grid.Row="1" Grid.Column="1" Value="2500" ValueChanged="UpDown_ValueChanged_1" Step="50"
/>

<TextBlock Margin="10,5,0,0" Grid.Row="3" Grid.Column="0" Text="Repulsion Strength" Height="25" VerticalAlignment="Center"/>
<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"
<TextBlock Margin="10,5,0,0" Grid.Row="2" Grid.Column="0" Text="Repulsion Strength" Height="25" VerticalAlignment="Center"/>
<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"
/>

<TextBlock Margin="10,0,0,0" Grid.Row="4" Grid.Column="0" Text="Attraction strength" Height="26" VerticalAlignment="Center"/>
<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"
<TextBlock Margin="10,0,0,0" Grid.Row="3" Grid.Column="0" Text="Attraction strength" Height="26" VerticalAlignment="Center"/>
<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"
/>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public MainWindow()
{
Layout = new ForceDirectedTree()
{
ConnectorLength = 110,
AttractionStrength = 0.6,
RepulsionStrength = 25000,
MaximumIteration = 2500,
Expand Down Expand Up @@ -195,13 +194,6 @@ private ConnectorViewModel Edge(string sourceId, string targetId)
// e.g. TargetDecorator = new DecoratorViewModel { Shape = DecoratorShapes.Arrow }
};
}

private void UpDown_ValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
if(Diagram.LayoutManager != null)
(Diagram.LayoutManager.Layout as ForceDirectedTree).ConnectorLength = (double)e.NewValue;
}

private void UpDown_ValueChanged_1(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
if (Diagram.LayoutManager != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<Setter Property="UnitWidth" Value="130"/>

</Style>

<!--Style for Connector-->
<Style TargetType="Syncfusion:Connector">
<Setter Property="ConnectorGeometryStyle">
Expand Down Expand Up @@ -102,33 +102,22 @@
<RowDefinition Height="35" ></RowDefinition>
<RowDefinition Height="35"></RowDefinition>
<RowDefinition Height="35" ></RowDefinition>
<RowDefinition Height="35"></RowDefinition>
<RowDefinition Height="35" ></RowDefinition>
<RowDefinition Height="75"></RowDefinition>
<RowDefinition Height="35"></RowDefinition>
<RowDefinition Height="35"></RowDefinition>
<RowDefinition Height="35"></RowDefinition>


</Grid.RowDefinitions>

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

<TextBlock Margin="10,5,0,0" Grid.Row="1" Grid.Column="0" Text="ConnectorLength" Height="25" VerticalAlignment="Center"/>
<Syncfusion:UpDown x:Name="connectorlength" MinValue="100" Margin="5,5,0,0" Grid.Row="1" Grid.Column="1" Step="5" MaxValue="170"
Value="{Binding ConnectorLength, Mode=TwoWay}" />

<TextBlock Margin="10,5,0,0" Grid.Row="2" Grid.Column="0" Text="Max Iteration" VerticalAlignment="Center" Height="25"/>
<Syncfusion:UpDown x:Name="maxiteration" MinValue="300" Margin="5,5,0,0" Grid.Row="2" Grid.Column="1" Step="50"
<TextBlock Margin="10,5,0,0" Grid.Row="1" Grid.Column="0" Text="Max Iteration" VerticalAlignment="Center" Height="25"/>
<Syncfusion:UpDown x:Name="maxiteration" MinValue="300" Margin="5,5,0,0" Grid.Row="1" Grid.Column="1" Step="50"
Value="{Binding MaximumIteration, Mode=TwoWay}"/>

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

<TextBlock Margin="10,0,0,0" Grid.Row="4" Grid.Column="0" Text="Attraction strength" Height="26" VerticalAlignment="Center"/>
<Syncfusion:UpDown x:Name="attractionstrength" MinValue="0.1" MaxValue="1" Margin="5,5,0,0" Grid.Row="4" Grid.Column="1" Step="0.1"
<TextBlock Grid.Row="3" Grid.Column="0" Text="Attraction strength" Height="26" VerticalAlignment="Center" HorizontalAlignment="Right" Width="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"
Value="{Binding AttractionStrength, Mode=TwoWay}" />

</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ public ForceDirectedViewModel()
{
Layout = new ForceDirectedTree()
{
ConnectorLength = 110,
AttractionStrength = 0.6,
RepulsionStrength = 25000,
MaximumIteration = 1000,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@
<syncfusion:SfDiagram.LayoutManager>
<syncfusion:LayoutManager>
<syncfusion:LayoutManager.Layout>
<syncfusion:ForceDirectedTree ConnectorLength="110"
<syncfusion:ForceDirectedTree
AttractionStrength="0.6"
RepulsionStrength="25000"
MaximumIteration="2500" />
Expand All @@ -493,32 +493,23 @@
<RowDefinition Height="45" ></RowDefinition>
<RowDefinition Height="45"></RowDefinition>
<RowDefinition Height="45" ></RowDefinition>
<RowDefinition Height="45"></RowDefinition>
<RowDefinition Height="45" ></RowDefinition>
<RowDefinition Height="45"></RowDefinition>
<RowDefinition Height="45" ></RowDefinition>
<RowDefinition Height="45"></RowDefinition>
<RowDefinition Height="45"></RowDefinition>


</Grid.RowDefinitions>

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

<TextBlock Margin="10,5,0,0" Grid.Row="1" Grid.Column="0" Text="ConnectorLength" Height="25" VerticalAlignment="Center"/>
<syncfusion:UpDown MinValue="50" Margin="5,5,0,0" Grid.Row="1" Grid.Column="1" Value="150" ValueChanged="UpDown_ValueChanged" Step="5" MaxValue="200"
/>

<TextBlock Margin="10,5,0,0" Grid.Row="2" Grid.Column="0" Text="Max Iteration" VerticalAlignment="Center" Height="25"/>
<syncfusion:UpDown MinValue="300" Margin="5,5,0,0" Grid.Row="2" Grid.Column="1" Value="2500" ValueChanged="UpDown_ValueChanged_1" Step="50"
<TextBlock Margin="10,5,0,0" Grid.Row="1" Grid.Column="0" Text="Max Iteration" VerticalAlignment="Center" Height="25"/>
<syncfusion:UpDown MinValue="300" Margin="5,5,0,0" Grid.Row="1" Grid.Column="1" Value="2500" ValueChanged="UpDown_ValueChanged_1" Step="50"
/>

<TextBlock Margin="10,5,0,0" Grid.Row="3" Grid.Column="0" Text="Repulsion Strength" Height="25" VerticalAlignment="Center"/>
<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"
<TextBlock Margin="10,5,0,0" Grid.Row="2" Grid.Column="0" Text="Repulsion Strength" Height="25" VerticalAlignment="Center"/>
<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"
/>

<TextBlock Margin="10,0,0,0" Grid.Row="4" Grid.Column="0" Text="Attraction strength" Height="26" VerticalAlignment="Center"/>
<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"
<TextBlock Margin="10,0,0,0" Grid.Row="3" Grid.Column="0" Text="Attraction strength" Height="26" VerticalAlignment="Center"/>
<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"
/>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,6 @@ private void Diagram_Loaded(object sender, RoutedEventArgs e)
(Diagram.Info as IGraphInfo).Commands.FitToPage.Execute(null);
temp = true;
}

private void UpDown_ValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
if (temp)
{
if ((Diagram.LayoutManager.Layout as ForceDirectedTree).ConnectorLength != (double)e.NewValue)
(Diagram.LayoutManager.Layout as ForceDirectedTree).ConnectorLength = (double)e.NewValue;
temp = true;
}
}

private void UpDown_ValueChanged_1(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
if (temp)
Expand Down