Skip to content

Commit 70d2d4a

Browse files
Merge pull request #97 from SatishRaj4377/WPF-948005-Animated_Connector_Sample
WPF-948005-Added Animated Connector Sample
2 parents 1ac433d + 00bc593 commit 70d2d4a

15 files changed

+639
-0
lines changed
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{C913D757-651B-4688-9A88-D46E5BBF5813}</ProjectGuid>
8+
<OutputType>WinExe</OutputType>
9+
<RootNamespace>AnimatedConnector</RootNamespace>
10+
<AssemblyName>AnimatedConnector</AssemblyName>
11+
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
14+
<WarningLevel>4</WarningLevel>
15+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
16+
<Deterministic>true</Deterministic>
17+
</PropertyGroup>
18+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
19+
<PlatformTarget>AnyCPU</PlatformTarget>
20+
<DebugSymbols>true</DebugSymbols>
21+
<DebugType>full</DebugType>
22+
<Optimize>false</Optimize>
23+
<OutputPath>bin\Debug\</OutputPath>
24+
<DefineConstants>DEBUG;TRACE</DefineConstants>
25+
<ErrorReport>prompt</ErrorReport>
26+
<WarningLevel>4</WarningLevel>
27+
</PropertyGroup>
28+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
29+
<PlatformTarget>AnyCPU</PlatformTarget>
30+
<DebugType>pdbonly</DebugType>
31+
<Optimize>true</Optimize>
32+
<OutputPath>bin\Release\</OutputPath>
33+
<DefineConstants>TRACE</DefineConstants>
34+
<ErrorReport>prompt</ErrorReport>
35+
<WarningLevel>4</WarningLevel>
36+
</PropertyGroup>
37+
<ItemGroup>
38+
<Reference Include="System" />
39+
<Reference Include="System.Data" />
40+
<Reference Include="System.Xml" />
41+
<Reference Include="Microsoft.CSharp" />
42+
<Reference Include="System.Core" />
43+
<Reference Include="System.Xml.Linq" />
44+
<Reference Include="System.Data.DataSetExtensions" />
45+
<Reference Include="System.Net.Http" />
46+
<Reference Include="System.Xaml">
47+
<RequiredTargetFramework>4.0</RequiredTargetFramework>
48+
</Reference>
49+
<Reference Include="WindowsBase" />
50+
<Reference Include="PresentationCore" />
51+
<Reference Include="PresentationFramework" />
52+
</ItemGroup>
53+
<ItemGroup>
54+
<ApplicationDefinition Include="App.xaml">
55+
<Generator>MSBuild:Compile</Generator>
56+
<SubType>Designer</SubType>
57+
</ApplicationDefinition>
58+
<Page Include="MainWindow.xaml">
59+
<Generator>MSBuild:Compile</Generator>
60+
<SubType>Designer</SubType>
61+
</Page>
62+
<Compile Include="App.xaml.cs">
63+
<DependentUpon>App.xaml</DependentUpon>
64+
<SubType>Code</SubType>
65+
</Compile>
66+
<Compile Include="MainWindow.xaml.cs">
67+
<DependentUpon>MainWindow.xaml</DependentUpon>
68+
<SubType>Code</SubType>
69+
</Compile>
70+
</ItemGroup>
71+
<ItemGroup>
72+
<Compile Include="Properties\AssemblyInfo.cs">
73+
<SubType>Code</SubType>
74+
</Compile>
75+
<Compile Include="Properties\Resources.Designer.cs">
76+
<AutoGen>True</AutoGen>
77+
<DesignTime>True</DesignTime>
78+
<DependentUpon>Resources.resx</DependentUpon>
79+
</Compile>
80+
<Compile Include="Properties\Settings.Designer.cs">
81+
<AutoGen>True</AutoGen>
82+
<DependentUpon>Settings.settings</DependentUpon>
83+
<DesignTimeSharedInput>True</DesignTimeSharedInput>
84+
</Compile>
85+
<EmbeddedResource Include="Properties\Resources.resx">
86+
<Generator>ResXFileCodeGenerator</Generator>
87+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
88+
</EmbeddedResource>
89+
<None Include="Properties\Settings.settings">
90+
<Generator>SettingsSingleFileGenerator</Generator>
91+
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
92+
</None>
93+
</ItemGroup>
94+
<ItemGroup>
95+
<None Include="App.config" />
96+
<PackageReference Include="Syncfusion.SfDiagram.WPF" Version="*"/>
97+
</ItemGroup>
98+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
99+
</Project>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.13.35818.85 d17.13
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AnimatedConnector_462", "AnimatedConnector_462.csproj", "{C913D757-651B-4688-9A88-D46E5BBF5813}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{C913D757-651B-4688-9A88-D46E5BBF5813}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{C913D757-651B-4688-9A88-D46E5BBF5813}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{C913D757-651B-4688-9A88-D46E5BBF5813}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{C913D757-651B-4688-9A88-D46E5BBF5813}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {37E03C98-4EC6-4234-9D35-26E1DE696243}
24+
EndGlobalSection
25+
EndGlobal
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<OutputType>WinExe</OutputType>
4+
<TargetFramework>net8.0-windows</TargetFramework>
5+
<UseWindowsForms>true</UseWindowsForms>
6+
<UseWPF>true</UseWPF>
7+
<EnableDefaultEmbeddedResourceItems>False</EnableDefaultEmbeddedResourceItems>
8+
<EnableDefaultItems>false</EnableDefaultItems>
9+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
10+
<AssemblyName>AnimatedConnector</AssemblyName>
11+
<RootNamespace>AnimatedConnector</RootNamespace>
12+
</PropertyGroup>
13+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
14+
<DefineConstants>TRACE;NET50</DefineConstants>
15+
</PropertyGroup>
16+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
17+
<DefineConstants>TRACE;NET50</DefineConstants>
18+
</PropertyGroup>
19+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Xml|AnyCPU'">
20+
<DefineConstants>TRACE;NET50</DefineConstants>
21+
</PropertyGroup>
22+
<ItemGroup>
23+
<Compile Remove="obj\**" />
24+
<Compile Remove="obj_45\**" />
25+
<Compile Remove="obj_462\**" />
26+
<Compile Remove="obj_50\**" />
27+
<Compile Remove="obj_60\**" />
28+
<Compile Remove="obj_70\**" />
29+
<Compile Remove="obj_80\**" />
30+
<Compile Remove="obj_90\**" />
31+
<EmbeddedResource Remove="obj\**" />
32+
<EmbeddedResource Remove="obj_45\**" />
33+
<EmbeddedResource Remove="obj_462\**" />
34+
<EmbeddedResource Remove="obj_50\**" />
35+
<EmbeddedResource Remove="obj_60\**" />
36+
<EmbeddedResource Remove="obj_70\**" />
37+
<EmbeddedResource Remove="obj_80\**" />
38+
<EmbeddedResource Remove="obj_90\**" />
39+
<None Remove="obj\**" />
40+
<None Remove="obj_45\**" />
41+
<None Remove="obj_462\**" />
42+
<None Remove="obj_50\**" />
43+
<None Remove="obj_60\**" />
44+
<None Remove="obj_70\**" />
45+
<None Remove="obj_80\**" />
46+
<None Remove="obj_90\**" />
47+
<Page Remove="obj\**" />
48+
<Page Remove="obj_45\**" />
49+
<Page Remove="obj_462\**" />
50+
<Page Remove="obj_50\**" />
51+
<Page Remove="obj_60\**" />
52+
<None Remove="obj_70\**" />
53+
<None Remove="obj_80\**" />
54+
<None Remove="obj_90\**" />
55+
<None Remove="Properties\Settings.settings" />
56+
<None Include="Properties\Settings.settings" />
57+
<None Remove="App.config" />
58+
<None Include="App.config" />
59+
<ApplicationDefinition Include="App.xaml" />
60+
<PackageReference Include="Syncfusion.SfDiagram.WPF" Version="*" />
61+
<Compile Include="App.xaml.cs" />
62+
<Compile Include="MainWindow.xaml.cs" />
63+
</ItemGroup>
64+
<ItemGroup>
65+
<Page Include="MainWindow.xaml">
66+
<Generator>MSBuild:Compile</Generator>
67+
</Page>
68+
</ItemGroup>
69+
</Project>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.13.35818.85 d17.13
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AnimatedConnector_80", "AnimatedConnector_80.csproj", "{B843291B-911A-3ACF-F39F-35791240420F}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{B843291B-911A-3ACF-F39F-35791240420F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{B843291B-911A-3ACF-F39F-35791240420F}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{B843291B-911A-3ACF-F39F-35791240420F}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{B843291B-911A-3ACF-F39F-35791240420F}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {DC2E3E5A-3808-4528-A9D8-20407B4E3037}
24+
EndGlobalSection
25+
EndGlobal
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
5+
</startup>
6+
</configuration>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Application x:Class="AnimatedConnector.App"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:local="clr-namespace:AnimatedConnector"
5+
StartupUri="MainWindow.xaml">
6+
<Application.Resources>
7+
8+
</Application.Resources>
9+
</Application>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Configuration;
4+
using System.Data;
5+
using System.Linq;
6+
using System.Threading.Tasks;
7+
using System.Windows;
8+
9+
namespace AnimatedConnector
10+
{
11+
/// <summary>
12+
/// Interaction logic for App.xaml
13+
/// </summary>
14+
public partial class App : Application
15+
{
16+
}
17+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<Window x:Class="AnimatedConnector.MainWindow"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6+
xmlns:local="clr-namespace:AnimatedConnector"
7+
mc:Ignorable="d" xmlns:sf="http://schemas.syncfusion.com/wpf"
8+
Title="Animated Connector" Height="450" Width="800" WindowState="Maximized">
9+
<Window.Resources>
10+
<Style TargetType="sf:Connector">
11+
<Setter Property="ConnectorGeometryStyle">
12+
<Setter.Value>
13+
<Style TargetType="Path">
14+
<Setter Property="Stroke" Value="Black"/>
15+
<Setter Property="StrokeThickness" Value="1"/>
16+
<!--Define the dash pattern for the connector line-->
17+
<Setter Property="StrokeDashArray" Value="2 4" />
18+
<Style.Triggers>
19+
<!--Animation trigger when the connector path is rendered-->
20+
<EventTrigger RoutedEvent="Path.Loaded">
21+
<BeginStoryboard>
22+
<!--Create an infinite animation for the flowing effect-->
23+
<Storyboard RepeatBehavior="Forever">
24+
<!--Animate the dash offset to create movement illusion-->
25+
<DoubleAnimation Storyboard.TargetProperty="StrokeDashOffset"
26+
From="6" To="0" Duration="0:0:0.5" />
27+
</Storyboard>
28+
</BeginStoryboard>
29+
</EventTrigger>
30+
</Style.Triggers>
31+
</Style>
32+
</Setter.Value>
33+
</Setter>
34+
</Style>
35+
<Style TargetType="sf:Node">
36+
<Setter Property="Shape">
37+
<Setter.Value>
38+
<RectangleGeometry Rect="0,0,100,100"/>
39+
</Setter.Value>
40+
</Setter>
41+
<Setter Property="ShapeStyle">
42+
<Setter.Value>
43+
<Style TargetType="Path">
44+
<Setter Property="Fill" Value="CornflowerBlue"/>
45+
<Setter Property="Stretch" Value="Fill"/>
46+
</Style>
47+
</Setter.Value>
48+
</Setter>
49+
</Style>
50+
</Window.Resources>
51+
<Grid>
52+
<sf:SfDiagram x:Name="Diagram" >
53+
<sf:SfDiagram.Nodes>
54+
<sf:NodeCollection>
55+
<!--Create two nodes-->
56+
<sf:NodeViewModel ID="1" OffsetX="300" OffsetY="150"/>
57+
<sf:NodeViewModel ID="2" OffsetX="850" OffsetY="450"/>
58+
</sf:NodeCollection>
59+
</sf:SfDiagram.Nodes>
60+
61+
<sf:SfDiagram.Connectors>
62+
<sf:ConnectorCollection>
63+
<sf:ConnectorViewModel SourceNodeID="1"
64+
TargetNodeID="2"/>
65+
</sf:ConnectorCollection>
66+
</sf:SfDiagram.Connectors>
67+
</sf:SfDiagram>
68+
69+
</Grid>
70+
</Window>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using System.Windows;
7+
using System.Windows.Controls;
8+
using System.Windows.Data;
9+
using System.Windows.Documents;
10+
using System.Windows.Input;
11+
using System.Windows.Media;
12+
using System.Windows.Media.Imaging;
13+
using System.Windows.Navigation;
14+
using System.Windows.Shapes;
15+
16+
namespace AnimatedConnector
17+
{
18+
/// <summary>
19+
/// Interaction logic for MainWindow.xaml
20+
/// </summary>
21+
public partial class MainWindow : Window
22+
{
23+
public MainWindow()
24+
{
25+
InitializeComponent();
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)