Merge remote-tracking branch 'upstream/PCL' into PCL
|
@ -114,3 +114,4 @@ UpgradeLog*.XML
|
|||
#LocalHistory VS plugin
|
||||
.localhistory/
|
||||
.settings/launch.json
|
||||
/.vs/GraphX for .NET/v15/Server/sqlite3
|
||||
|
|
|
@ -4,9 +4,9 @@ using System.Reflection;
|
|||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("panthernet dev works")]
|
||||
[assembly: AssemblyProduct("GraphX for .NET")]
|
||||
[assembly: AssemblyCopyright("Copyright www.panthernet.ru © 2016")]
|
||||
[assembly: AssemblyCopyright("Copyright www.panthernet.ru © 2018")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
[assembly: AssemblyVersion("2.3.6.0")]
|
||||
[assembly: AssemblyFileVersion("2.3.6.0")]
|
||||
[assembly: AssemblyVersion("2.3.8.0")]
|
||||
[assembly: AssemblyFileVersion("2.3.8.0")]
|
||||
|
|
|
@ -1,5 +1,44 @@
|
|||
WIP 2.3.7
|
||||
- Fixed SimpleTreeLayout vertex sizes supplement
|
||||
RELEASE 2.3.8
|
||||
- Implemented multiple labels logic for edges. Now you can display multiple labels across the edge
|
||||
- Added LabelHorizontalOffset property for labels which offsets labels along the edge given some offset value in total edge length percent
|
||||
- Improved graph print logic to work with ulong dimensions instead of int
|
||||
|
||||
CODE CHANGES:
|
||||
- Properties ShowLabel,LabelVerticalOffset,AlignLabelsToEdges moved from EdgeControlBase to EdgeLabelControl class
|
||||
- Property AlignLabelsToEdges renamed to AlignToEdge
|
||||
- Property EdgeControlBase.EdgeLabelControl renamed to EdgeLabelControls and now has IList<IEdgeLabelControl> type
|
||||
- Added new method IList<SysRect> EdgeControlBase.GetLabelSizes()
|
||||
- Added new method IList<IEdgeLabelControl> EdgeControlBase.GetLabelControls()
|
||||
- GraphArea.ShowAllEdgesLabels() method now has one-time effect and will not be reapplied after relayout
|
||||
- GraphArea.ShowAllEdgesLabels() method now has one-time effect and will not be reapplied after relayout
|
||||
- GraphArea.EdgeLabelFactory is now setup up with default factory generating one AttachableEdgeLabelControl
|
||||
- Label factory method CreateLabel() now returns IEnumerable<TResult> to accomodate multiple labels generation during single factory pass
|
||||
|
||||
OBSOLETE AND REMOVED STUFF:
|
||||
General
|
||||
- Old style arrows are now not supported
|
||||
- Old style edge labels (EdgeLabelControl) are now not supported, make sure to remove it from XAML templates and update your code to use AttachableEdgeLabelControl
|
||||
|
||||
EdgeControlBase
|
||||
- LabelAngle
|
||||
- GetLabelSize()
|
||||
- SetCustomLabelSize()
|
||||
|
||||
EdgeControl
|
||||
- LabelMouseDown event removed
|
||||
|
||||
Other:
|
||||
- showLabel parameter has been removed from all EdgeControl constructors and factories
|
||||
|
||||
|
||||
RELEASE 2.3.7
|
||||
- Added edge drag functionality to be able to reattach edge to another vertex (thanks to LaborJos)
|
||||
- Fixed SimpleTreeLayout vertex sizes supplement (thanks to edgardozoppi)
|
||||
- Fixed and improved parallel edge handling (thanks to perturbare)
|
||||
- Fixed RemoveEdge() method were not removing edges from data graph (thanks to perturbare)
|
||||
- Removed METRO support and example
|
||||
- Added UAP (UWP) support for Windows 10+ platform (VS2017)
|
||||
- Minor bugfixes
|
||||
|
||||
RELEASE 2.3.6
|
||||
DETAILED CHANGELOG:
|
||||
|
|
|
@ -1,175 +0,0 @@
|
|||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls1="using:GraphX.Controls">
|
||||
|
||||
<Style TargetType="controls1:VertexControl">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls1:VertexControl">
|
||||
<Grid>
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="PointerOver">
|
||||
<Storyboard>
|
||||
<DoubleAnimation To="1.5" Duration="00:00:1"
|
||||
Storyboard.TargetName="bigEllipse"
|
||||
Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)">
|
||||
<DoubleAnimation.EasingFunction>
|
||||
<BounceEase Bounces="2" EasingMode="EaseOut" Bounciness="2" />
|
||||
</DoubleAnimation.EasingFunction>
|
||||
</DoubleAnimation>
|
||||
<DoubleAnimation To="1.5" Duration="00:00:1"
|
||||
Storyboard.TargetName="bigEllipse"
|
||||
Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)">
|
||||
<DoubleAnimation.EasingFunction>
|
||||
<BounceEase Bounces="2" EasingMode="EaseOut" Bounciness="2" />
|
||||
</DoubleAnimation.EasingFunction>
|
||||
</DoubleAnimation>
|
||||
<DoubleAnimation To="1.5" Duration="00:00:1"
|
||||
Storyboard.TargetName="smallEllipse"
|
||||
Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)">
|
||||
<DoubleAnimation.EasingFunction>
|
||||
<BounceEase Bounces="4" EasingMode="EaseOut" Bounciness="2" />
|
||||
</DoubleAnimation.EasingFunction>
|
||||
</DoubleAnimation>
|
||||
<DoubleAnimation To="1.5" Duration="00:00:1"
|
||||
Storyboard.TargetName="smallEllipse"
|
||||
Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)">
|
||||
<DoubleAnimation.EasingFunction>
|
||||
<BounceEase Bounces="4" EasingMode="EaseOut" Bounciness="2" />
|
||||
</DoubleAnimation.EasingFunction>
|
||||
</DoubleAnimation>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="PointerLeave">
|
||||
<Storyboard>
|
||||
<DoubleAnimation To="1" Duration="00:00:1"
|
||||
Storyboard.TargetName="bigEllipse"
|
||||
Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)">
|
||||
<DoubleAnimation.EasingFunction>
|
||||
<BounceEase Bounces="2" EasingMode="EaseOut" Bounciness="2" />
|
||||
</DoubleAnimation.EasingFunction>
|
||||
</DoubleAnimation>
|
||||
<DoubleAnimation To="1" Duration="00:00:1"
|
||||
Storyboard.TargetName="bigEllipse"
|
||||
Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)">
|
||||
<DoubleAnimation.EasingFunction>
|
||||
<BounceEase Bounces="2" EasingMode="EaseOut" Bounciness="2" />
|
||||
</DoubleAnimation.EasingFunction>
|
||||
</DoubleAnimation>
|
||||
<DoubleAnimation To="1" Duration="00:00:1"
|
||||
Storyboard.TargetName="smallEllipse"
|
||||
Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)">
|
||||
<DoubleAnimation.EasingFunction>
|
||||
<BounceEase Bounces="4" EasingMode="EaseOut" Bounciness="2" />
|
||||
</DoubleAnimation.EasingFunction>
|
||||
</DoubleAnimation>
|
||||
<DoubleAnimation To="1" Duration="00:00:1"
|
||||
Storyboard.TargetName="smallEllipse"
|
||||
Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)">
|
||||
<DoubleAnimation.EasingFunction>
|
||||
<BounceEase Bounces="4" EasingMode="EaseOut" Bounciness="2" />
|
||||
</DoubleAnimation.EasingFunction>
|
||||
</DoubleAnimation>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<Ellipse Name="bigEllipse" Width="{Binding VisualDiameter}" Height="{Binding VisualDiameter}"
|
||||
Stroke="Gray" StrokeThickness="{Binding VisualOuterRingThickness}" Fill="#3771FD" RenderTransformOrigin=".5,.5">
|
||||
<Ellipse.RenderTransform>
|
||||
<CompositeTransform CenterX=".5" CenterY=".5"/>
|
||||
</Ellipse.RenderTransform>
|
||||
</Ellipse>
|
||||
<Ellipse Name="smallEllipse" Width="{Binding VisualInnerDiameter}" Height="{Binding VisualInnerDiameter}"
|
||||
Stroke="Transparent" StrokeThickness="0" Fill="#3DFF98" RenderTransformOrigin=".5,.5">
|
||||
<Ellipse.RenderTransform>
|
||||
<CompositeTransform CenterX=".5" CenterY=".5"/>
|
||||
</Ellipse.RenderTransform>
|
||||
</Ellipse>
|
||||
<controls1:VertexLabelControl x:Name="PART_vertexLabel" Content="{Binding LabelText}" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="controls1:EdgeControl">
|
||||
<Setter Property="LabelVerticalOffset" Value="10" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls1:EdgeControl">
|
||||
<Grid>
|
||||
<Path x:Name="PART_edgePath"
|
||||
StrokeThickness="{Binding VisualEdgeThickness}"
|
||||
ToolTipService.ToolTip="{TemplateBinding ToolTipService.ToolTip}"
|
||||
Opacity="{Binding VisualEdgeTransparency}">
|
||||
<Path.Stroke>
|
||||
<SolidColorBrush Color="{Binding VisualColor}"/>
|
||||
</Path.Stroke>
|
||||
</Path>
|
||||
|
||||
<controls1:DefaultEdgePointer NeedRotation="true" x:Name="PART_EdgePointerForTarget" >
|
||||
<Path Data="M0,0.5 L1,1 1,0" Fill="Yellow" Stretch="Uniform" Width="15" Height="15"/>
|
||||
</controls1:DefaultEdgePointer>
|
||||
|
||||
<Path x:Name="PART_SelfLoopedEdge"
|
||||
Width="10"
|
||||
Height="10"
|
||||
Stretch="Uniform"
|
||||
Fill="{TemplateBinding Foreground}"
|
||||
Data="F1 M 17.4167,32.25L 32.9107,32.25L 38,18L 43.0893,32.25L 58.5833,32.25L 45.6798,41.4944L 51.4583,56L 38,48.0833L 26.125,56L 30.5979,41.7104L 17.4167,32.25 Z "/>
|
||||
|
||||
<controls1:EdgeLabelControl x:Name="PART_edgeLabel"
|
||||
Content="{Binding Text}"
|
||||
Opacity="{Binding VisualEdgeTransparency}"
|
||||
/>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
||||
</Style>
|
||||
|
||||
<!--EDGE LABLE CONTROL -->
|
||||
<Style TargetType="controls1:EdgeLabelControl">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls1:EdgeLabelControl">
|
||||
<Grid>
|
||||
<ContentPresenter Margin="3" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
|
||||
<!--VERTEX LABEL CONTROL -->
|
||||
<Style TargetType="controls1:VertexLabelControl">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="LabelPositionMode" Value="Sides"/>
|
||||
<Setter Property="LabelPositionSide" Value="BottomRight"/>
|
||||
<Setter Property="FontSize" Value="10" />
|
||||
<Setter Property="Angle" Value="-45"></Setter>
|
||||
|
||||
<!-- Custom label template body -->
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls1:VertexLabelControl">
|
||||
<Grid>
|
||||
<ContentPresenter Margin="3" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
|
@ -1,230 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{44841666-C547-4874-9BC9-B34D2A1FA6D8}</ProjectGuid>
|
||||
<OutputType>appcontainerexe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>METRO.SimpleGraph</RootNamespace>
|
||||
<AssemblyName>METRO.SimpleGraph</AssemblyName>
|
||||
<DefaultLanguage>en-US</DefaultLanguage>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<PackageCertificateKeyFile>METRO.SimpleGraph_TemporaryKey.pfx</PackageCertificateKeyFile>
|
||||
<TargetPlatformVersion>8.1</TargetPlatformVersion>
|
||||
<MinimumVisualStudioVersion>12</MinimumVisualStudioVersion>
|
||||
<TargetFrameworkVersion />
|
||||
<PackageCertificateThumbprint>0E531EEE26E7E3F2FBD6A8E1E9F889D31225622F</PackageCertificateThumbprint>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
|
||||
<RestorePackages>true</RestorePackages>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;NETFX_CORE, METRO</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
<NoWarn>1591</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NETFX_CORE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn>1591</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\ARM\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>ARM</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
|
||||
<OutputPath>bin\ARM\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NETFX_CORE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>ARM</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NETFX_CORE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NETFX_CORE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
|
||||
<ProjectReference Include="..\..\GraphX.METRO.Controls\GraphX.METRO.Controls.csproj">
|
||||
<Project>{66f33708-c1c7-4385-8235-7201784d184c}</Project>
|
||||
<Name>GraphX.METRO.Controls</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\GraphX.PCL.Common\GraphX.PCL.Common.csproj">
|
||||
<Project>{3644d44b-dec0-4b65-bba0-c68e34821aae}</Project>
|
||||
<Name>GraphX.PCL.Common</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\GraphX.PCL.Logic\GraphX.PCL.Logic.csproj">
|
||||
<Project>{a30d218b-aaa4-483a-99f7-eaeb1b8b4610}</Project>
|
||||
<Name>GraphX.PCL.Logic</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MainPageDebug.xaml.cs">
|
||||
<DependentUpon>MainPageDebug.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MainPage.xaml.cs">
|
||||
<DependentUpon>MainPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Models\CurvedEr.cs" />
|
||||
<Compile Include="Models\CurvedErParameters.cs" />
|
||||
<Compile Include="Models\DataEdge.cs" />
|
||||
<Compile Include="Models\DataVertex.cs" />
|
||||
<Compile Include="Models\DebugItems.cs" />
|
||||
<Compile Include="Models\GraphAreaExample.cs" />
|
||||
<Compile Include="Models\GraphExample.cs" />
|
||||
<Compile Include="Models\GXLogicCoreExample.cs" />
|
||||
<Compile Include="Models\MouseOverScaleAnimation.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AppxManifest Include="Package.appxmanifest">
|
||||
<SubType>Designer</SubType>
|
||||
</AppxManifest>
|
||||
<None Include="METRO.SimpleGraph_TemporaryKey.pfx" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Assets\Logo.png" />
|
||||
<Content Include="Assets\MidLogo.png" />
|
||||
<Content Include="Assets\play.png" />
|
||||
<Content Include="Assets\refresh.png" />
|
||||
<Content Include="Assets\SmallLogo.png" />
|
||||
<Content Include="Assets\SplashScreen.png" />
|
||||
<Content Include="Assets\StoreLogo.png" />
|
||||
<Content Include="Assets\tr_grren.png" />
|
||||
<Content Include="Assets\tr_red.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Page Include="Common\StandardStyles.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Common\templates2.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Page>
|
||||
<Page Include="MainPageDebug.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="MainPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Common\templates.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="QuickGraph, Version=3.6.61114.0, Culture=neutral, PublicKeyToken=f3fb40175eec2af3, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\QuickGraphPCL.3.6.61114.2\lib\portable-win+net4+sl5+wp8+win8+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\QuickGraph.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="QuickGraph.Graphviz, Version=3.6.61114.0, Culture=neutral, PublicKeyToken=f3fb40175eec2af3, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\QuickGraphPCL.3.6.61114.2\lib\portable-win+net4+sl5+wp8+win8+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\QuickGraph.Graphviz.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '12.0' ">
|
||||
<VisualStudioVersion>12.0</VisualStudioVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<StartupObject />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<AssemblyOriginatorKeyFile>METRO.SimpleGraph_TemporaryKey.pfx</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
||||
</Target>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
Двоичные данные
Examples/METRO.SimpleGraph/METRO.SimpleGraph_TemporaryKey.pfx
|
@ -1,37 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest">
|
||||
<Identity Name="2c81b400-35e9-4947-b413-ba38af6a935c" Publisher="CN=panthernet" Version="1.1.0.0" />
|
||||
<Properties>
|
||||
<DisplayName>METRO.SimpleGraph</DisplayName>
|
||||
<PublisherDisplayName>panth_000</PublisherDisplayName>
|
||||
<Logo>Assets\StoreLogo.png</Logo>
|
||||
</Properties>
|
||||
<Prerequisites>
|
||||
<OSMinVersion>6.3.0</OSMinVersion>
|
||||
<OSMaxVersionTested>6.3.0</OSMaxVersionTested>
|
||||
</Prerequisites>
|
||||
<Resources>
|
||||
<Resource Language="x-generate" />
|
||||
</Resources>
|
||||
<Applications>
|
||||
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="METRO.SimpleGraph.App">
|
||||
<m2:VisualElements DisplayName="METRO.SimpleGraph" Description="METRO.SimpleGraph" BackgroundColor="#464646" ForegroundText="light" Square150x150Logo="Assets\Logo.png" Square30x30Logo="Assets\SmallLogo.png">
|
||||
<m2:DefaultTile>
|
||||
<m2:ShowNameOnTiles>
|
||||
<m2:ShowOn Tile="square150x150Logo" />
|
||||
</m2:ShowNameOnTiles>
|
||||
</m2:DefaultTile>
|
||||
<m2:InitialRotationPreference>
|
||||
<m2:Rotation Preference="portrait" />
|
||||
<m2:Rotation Preference="landscape" />
|
||||
<m2:Rotation Preference="portraitFlipped" />
|
||||
<m2:Rotation Preference="landscapeFlipped" />
|
||||
</m2:InitialRotationPreference>
|
||||
<m2:SplashScreen Image="Assets\SplashScreen.png" />
|
||||
</m2:VisualElements>
|
||||
</Application>
|
||||
</Applications>
|
||||
<Capabilities>
|
||||
<Capability Name="internetClient" />
|
||||
</Capabilities>
|
||||
</Package>
|
|
@ -1,16 +0,0 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("METRO.SimpleGraph")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("METRO.SimpleGraph")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2014")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
[assembly: ComVisible(false)]
|
|
@ -1,4 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="QuickGraphPCL" version="3.6.61114.2" targetFramework="win81" />
|
||||
</packages>
|
|
@ -289,6 +289,7 @@ namespace ShowcaseApp.WPF.Pages
|
|||
|
||||
erg_Area.GenerateGraph(gr, true);
|
||||
erg_Area.SetVerticesDrag(true, true);
|
||||
erg_Area.SetEdgesDrag(true);
|
||||
erg_zoomctrl.ZoomToFill();
|
||||
|
||||
return;
|
||||
|
|
|
@ -138,6 +138,7 @@ namespace ShowcaseApp.WPF.Pages
|
|||
_opMode = EditorOperationMode.Select;
|
||||
ClearEditMode();
|
||||
graphArea.SetVerticesDrag(true, true);
|
||||
graphArea.SetEdgesDrag(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,10 +49,11 @@ namespace ShowcaseApp.WPF.Pages
|
|||
gg_Area.RelayoutFinished += gg_Area_RelayoutFinished;
|
||||
gg_Area.GenerateGraphFinished += gg_Area_GenerateGraphFinished;
|
||||
gg_Area.VertexLabelFactory = new DefaultVertexlabelFactory();
|
||||
gg_Area.SetEdgesDrag(true);
|
||||
|
||||
ggLogic.DefaultEdgeRoutingAlgorithm = EdgeRoutingAlgorithmTypeEnum.SimpleER;
|
||||
ggLogic.EdgeCurvingEnabled = true;
|
||||
gg_Area.ShowAllEdgesArrows(true);
|
||||
gg_Area.ShowAllEdgesArrows();
|
||||
|
||||
ZoomControl.SetViewFinderVisibility(gg_zoomctrl, Visibility.Visible);
|
||||
|
||||
|
|
|
@ -3,6 +3,8 @@ using System.ComponentModel;
|
|||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using GraphX.Controls;
|
||||
using GraphX.Controls.Models;
|
||||
using GraphX.PCL.Common.Enums;
|
||||
using ShowcaseApp.WPF.Annotations;
|
||||
using ShowcaseApp.WPF.Models;
|
||||
|
@ -35,6 +37,7 @@ namespace ShowcaseApp.WPF.Pages.Mini
|
|||
|
||||
cbEnablePE.Checked += CbMathShapeOnChecked;
|
||||
cbEnablePE.Unchecked += CbMathShapeOnChecked;
|
||||
graphArea.EdgeLabelFactory = new DefaultEdgelabelFactory();
|
||||
}
|
||||
|
||||
private void CbMathShapeOnChecked(object sender, RoutedEventArgs routedEventArgs)
|
||||
|
@ -88,12 +91,12 @@ namespace ShowcaseApp.WPF.Pages.Mini
|
|||
zoomControl.MaxZoom = 50;
|
||||
//manual edge corrections
|
||||
var eList = graphArea.EdgesList.Values.ToList();
|
||||
eList[0].LabelVerticalOffset = 12;
|
||||
eList[1].LabelVerticalOffset = 12;
|
||||
eList[0].GetLabelControls().FirstOrDefault().LabelVerticalOffset = 12;
|
||||
eList[1].GetLabelControls().FirstOrDefault().LabelVerticalOffset = 12;
|
||||
|
||||
eList[2].ShowLabel = false;
|
||||
eList[3].LabelVerticalOffset = 12;
|
||||
eList[4].LabelVerticalOffset = 12;
|
||||
eList[2].GetLabelControls().FirstOrDefault().ShowLabel = false;
|
||||
// eList[3].GetLabelControls().FirstOrDefault().LabelVerticalOffset = 12;
|
||||
// eList[4].GetLabelControls().FirstOrDefault().LabelVerticalOffset = -12;
|
||||
|
||||
//PS: to see how parallel edges logic works go to GraphArea::UpdateParallelEdgesData() method
|
||||
|
||||
|
|
|
@ -1,63 +1,73 @@
|
|||
<UserControl x:Class="ShowcaseApp.WPF.Pages.Mini.LayoutVCP"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:wpf="clr-namespace:ShowcaseApp.WPF"
|
||||
xmlns:controls="http://schemas.panthernet.ru/graphx/"
|
||||
xmlns:mui="http://firstfloorsoftware.com/ModernUI"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:models="clr-namespace:ShowcaseApp.WPF.Models"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300" d:DesignWidth="600">
|
||||
xmlns:mui="http://firstfloorsoftware.com/ModernUI"
|
||||
xmlns:wpf="clr-namespace:ShowcaseApp.WPF"
|
||||
d:DesignHeight="300"
|
||||
d:DesignWidth="600"
|
||||
mc:Ignorable="d">
|
||||
<Grid>
|
||||
<Grid.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="/Templates/MiniFeatures.xaml"/>
|
||||
<ResourceDictionary Source="/Templates/Mini/LayoutVCPTemplate.xaml"/>
|
||||
<ResourceDictionary Source="/Templates/MiniFeatures.xaml" />
|
||||
<ResourceDictionary Source="/Templates/Mini/LayoutVCPTemplate.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
|
||||
|
||||
</Grid.Resources>
|
||||
|
||||
<Border BorderBrush="{DynamicResource ButtonBorder}" BorderThickness="1" Margin="2" >
|
||||
<controls:ZoomControl x:Name="zoomControl" Background="{DynamicResource ButtonBackground}" Foreground="{DynamicResource ButtonText}" HorizontalContentAlignment="Center" VerticalAlignment="Center">
|
||||
<wpf:GraphAreaExample x:Name="graphArea"/>
|
||||
|
||||
<Border Margin="2"
|
||||
BorderBrush="{DynamicResource ButtonBorder}"
|
||||
BorderThickness="1">
|
||||
<controls:ZoomControl x:Name="zoomControl"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalContentAlignment="Center"
|
||||
Background="{DynamicResource ButtonBackground}"
|
||||
Foreground="{DynamicResource ButtonText}">
|
||||
<wpf:GraphAreaExample x:Name="graphArea" />
|
||||
</controls:ZoomControl>
|
||||
</Border>
|
||||
|
||||
<Expander VerticalAlignment="Bottom"
|
||||
Margin="2"
|
||||
IsExpanded="false"
|
||||
ExpandDirection="Down"
|
||||
Header="SETTINGS"
|
||||
Template="{DynamicResource MiniExpander}"
|
||||
Padding="5">
|
||||
|
||||
<StackPanel Orientation="Vertical" MinHeight="50" VerticalAlignment="Center"
|
||||
Margin="10">
|
||||
<CheckBox Height="25"
|
||||
Name="cbMathShape"
|
||||
IsChecked="True"
|
||||
Content ="Use math shape for connector"
|
||||
ToolTip="If math shape is specified an edge will connect to the point around some math shape. If not it will simply point to connector center."
|
||||
/>
|
||||
<Button Content="Add VCP from runtime" Margin="2" Name="butAddVcp" HorizontalAlignment="Left"/>
|
||||
<Expander Margin="2"
|
||||
VerticalAlignment="Bottom"
|
||||
ExpandDirection="Down"
|
||||
Header="SETTINGS"
|
||||
IsExpanded="false"
|
||||
Padding="5"
|
||||
Template="{DynamicResource MiniExpander}">
|
||||
|
||||
<StackPanel MinHeight="50"
|
||||
Margin="10"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Vertical">
|
||||
<CheckBox Name="cbMathShape"
|
||||
Height="25"
|
||||
Content="Use math shape for connector"
|
||||
IsChecked="True"
|
||||
ToolTip="If math shape is specified an edge will connect to the point around some math shape. If not it will simply point to connector center." />
|
||||
<Button Name="butAddVcp"
|
||||
Margin="2"
|
||||
HorizontalAlignment="Left"
|
||||
Content="Add VCP from runtime" />
|
||||
</StackPanel>
|
||||
</Expander>
|
||||
|
||||
<Border HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
<Border Margin="0,2,2,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
Background="{DynamicResource WindowBackground}"
|
||||
BorderBrush="{DynamicResource ButtonBorder}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="0,0,0,15"
|
||||
Margin="0,2,2,0">
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<mui:ModernButton Style="{DynamicResource MainControlButtonHelp}"
|
||||
Command="models:LinkCommands.ShowMiniSpecialDialog"
|
||||
BorderBrush="{DynamicResource ButtonBorder}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="0,0,0,15">
|
||||
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
|
||||
<mui:ModernButton Command="models:LinkCommands.ShowMiniSpecialDialog"
|
||||
CommandParameter="{x:Static models:MiniSpecialType.LayoutVCP}"
|
||||
/>
|
||||
Style="{DynamicResource MainControlButtonHelp}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
|
|
@ -54,7 +54,7 @@ namespace ShowcaseApp.WPF.Pages.Mini
|
|||
private void CbMathShapeOnChecked(object sender, RoutedEventArgs routedEventArgs)
|
||||
{
|
||||
foreach(var item in graphArea.VertexList.Values)
|
||||
item.VertexConnectionPointsList.ForEach(a => a.Shape = cbMathShape.IsChecked == true ? VertexShape.Circle : VertexShape.None);
|
||||
item.VertexConnectionPointsList.ForEach(a => a.Shape = cbMathShape.IsChecked == true ? VertexShape.Circle : VertexShape.None);
|
||||
graphArea.UpdateAllEdges(true);
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ namespace ShowcaseApp.WPF.Pages.Mini
|
|||
ShowcaseHelper.AddEdge(logicCore.Graph, vList[5], vList[2], 2, 3);
|
||||
|
||||
graphArea.LogicCore = logicCore;
|
||||
//set positions
|
||||
//set positions
|
||||
var posList = new Dictionary<DataVertex, Point>()
|
||||
{
|
||||
{vList[0], new Point(0, 0)},
|
||||
|
@ -99,6 +99,7 @@ namespace ShowcaseApp.WPF.Pages.Mini
|
|||
|
||||
//settings
|
||||
graphArea.SetVerticesDrag(true, true);
|
||||
graphArea.SetEdgesDrag(true);
|
||||
|
||||
zoomControl.ZoomToFill();
|
||||
}
|
||||
|
|
|
@ -1,42 +1,53 @@
|
|||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="http://schemas.panthernet.ru/graphx/">
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="http://schemas.panthernet.ru/graphx/">
|
||||
|
||||
<!--<Style TargetType="{x:Type local:GraphAreaExample}">
|
||||
<Setter Property="Background" Value="LightGray"/>
|
||||
</Style>-->
|
||||
</Style>-->
|
||||
|
||||
<Style TargetType="controls:StaticVertexConnectionPoint" x:Shared="False">
|
||||
<Setter Property="Shape" Value="Circle"/>
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
<Style x:Shared="False" TargetType="controls:StaticVertexConnectionPoint">
|
||||
<Setter Property="Shape" Value="Circle" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="Content">
|
||||
<Setter.Value>
|
||||
<Path Stroke="Black" Data="M 38,0.791664C 58.5496,0.791664 75.2083,17.4504 75.2083,38C 75.2083,58.5496 58.5496,75.2083 38,75.2083C 17.4504,75.2083 0.791662,58.5496 0.791662,38C 0.791662,17.4504 17.4504,0.791664 38,0.791664 Z M 38,5.54166C 20.0738,5.54166 5.54167,20.0738 5.54167,38C 5.54167,55.9262 20.0738,70.4583 38,70.4583C 55.9262,70.4583 70.4583,55.9262 70.4583,38C 70.4583,20.0738 55.9262,5.54166 38,5.54166 Z "
|
||||
Width="10" Height="10" Stretch="Uniform" StrokeThickness="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
<Path Width="10"
|
||||
Height="10"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Data="M 38,0.791664C 58.5496,0.791664 75.2083,17.4504 75.2083,38C 75.2083,58.5496 58.5496,75.2083 38,75.2083C 17.4504,75.2083 0.791662,58.5496 0.791662,38C 0.791662,17.4504 17.4504,0.791664 38,0.791664 Z M 38,5.54166C 20.0738,5.54166 5.54167,20.0738 5.54167,38C 5.54167,55.9262 20.0738,70.4583 38,70.4583C 55.9262,70.4583 70.4583,55.9262 70.4583,38C 70.4583,20.0738 55.9262,5.54166 38,5.54166 Z "
|
||||
Stretch="Uniform"
|
||||
Stroke="Black"
|
||||
StrokeThickness="1" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
|
||||
|
||||
|
||||
<Style TargetType="{x:Type controls:VertexControl}">
|
||||
<Setter Property="Background" Value="Yellow"/>
|
||||
<Setter Property="Background" Value="Yellow" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type controls:VertexControl}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border Name="bb" Background="{TemplateBinding Background}" Grid.Column="1"
|
||||
BorderBrush="{TemplateBinding BorderBrush}" Width="20" Height="20" BorderThickness="1">
|
||||
</Border>
|
||||
<StackPanel Orientation="Vertical" Grid.Column="0" Name="PART_vcproot">
|
||||
<Border Padding="0" Margin="2,2,0,2">
|
||||
<controls:StaticVertexConnectionPoint Id="1"/>
|
||||
<StackPanel Name="PART_vcproot"
|
||||
Grid.Column="0"
|
||||
Orientation="Vertical">
|
||||
<Border Margin="2,2,0,2" Padding="0">
|
||||
<controls:StaticVertexConnectionPoint Id="1" />
|
||||
</Border>
|
||||
</StackPanel>
|
||||
<Border Name="bb"
|
||||
Grid.Column="1"
|
||||
Width="20"
|
||||
Height="20"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="1" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
|
@ -44,11 +55,13 @@
|
|||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsBlue}" Value="True">
|
||||
<DataTrigger.Setters>
|
||||
<Setter Property="Background" Value="Blue"/>
|
||||
<Setter Property="Background" Value="Blue" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type controls:VertexControl}">
|
||||
<Ellipse Width="50" Height="50" Fill="{TemplateBinding Background}"/>
|
||||
<Ellipse Width="50"
|
||||
Height="50"
|
||||
Fill="{TemplateBinding Background}" />
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
@ -59,71 +72,89 @@
|
|||
|
||||
|
||||
<controls:VisibilityToBoolConverter x:Key="VisibilityToBoolConverter" Inverted="True" />
|
||||
<controls:VisibilityToBoolConverter x:Key="VisibilityToBoolConverterNot" Inverted="True" Not="True"/>
|
||||
|
||||
<controls:VisibilityToBoolConverter x:Key="VisibilityToBoolConverterNot"
|
||||
Inverted="True"
|
||||
Not="True" />
|
||||
|
||||
<Style TargetType="{x:Type controls:EdgeControl}">
|
||||
<Setter Property="Foreground" Value="Black"/>
|
||||
<Setter Property="Foreground" Value="Black" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type controls:EdgeControl}">
|
||||
<Grid>
|
||||
<Path Stroke="{TemplateBinding Foreground}"
|
||||
StrokeThickness="1"
|
||||
x:Name="PART_edgePath"/>
|
||||
<controls:DefaultEdgePointer NeedRotation="true" x:Name="PART_EdgePointerForSource" Visibility="{Binding ArrowTarget, Converter={StaticResource VisibilityToBoolConverterNot}}">
|
||||
<Path Data="M0,0.5 L1,1 1,0" Fill="Black" Stretch="Uniform" Width="7" Height="7" />
|
||||
<Path x:Name="PART_edgePath"
|
||||
Stroke="{TemplateBinding Foreground}"
|
||||
StrokeThickness="1" />
|
||||
<controls:DefaultEdgePointer x:Name="PART_EdgePointerForSource"
|
||||
NeedRotation="true"
|
||||
Visibility="{Binding ArrowTarget,
|
||||
Converter={StaticResource VisibilityToBoolConverterNot}}">
|
||||
<Path Width="7"
|
||||
Height="7"
|
||||
Data="M0,0.5 L1,1 1,0"
|
||||
Fill="Black"
|
||||
Stretch="Uniform" />
|
||||
</controls:DefaultEdgePointer>
|
||||
<controls:DefaultEdgePointer NeedRotation="true" x:Name="PART_EdgePointerForTarget" Visibility="{Binding ArrowTarget, Converter={StaticResource VisibilityToBoolConverter}}">
|
||||
<Path Data="M0,0.5 L1,1 1,0" Fill="Black" Stretch="Uniform" Width="7" Height="7"/>
|
||||
<controls:DefaultEdgePointer x:Name="PART_EdgePointerForTarget"
|
||||
NeedRotation="true"
|
||||
Visibility="{Binding ArrowTarget,
|
||||
Converter={StaticResource VisibilityToBoolConverter}}">
|
||||
<Path Width="7"
|
||||
Height="7"
|
||||
Data="M0,0.5 L1,1 1,0"
|
||||
Fill="Black"
|
||||
Stretch="Uniform" />
|
||||
</controls:DefaultEdgePointer>
|
||||
<!-- <Path x:Name="PART_SelfLoopedEdge"
|
||||
Width="10"
|
||||
Height="10"
|
||||
Stretch="Uniform"
|
||||
Fill="{TemplateBinding Foreground}"
|
||||
Data="F1 M 17.4167,32.25L 32.9107,32.25L 38,18L 43.0893,32.25L 58.5833,32.25L 45.6798,41.4944L 51.4583,56L 38,48.0833L 26.125,56L 30.5979,41.7104L 17.4167,32.25 Z "/>
|
||||
-->
|
||||
<!-- <Path x:Name="PART_SelfLoopedEdge"
|
||||
Width="10"
|
||||
Height="10"
|
||||
Stretch="Uniform"
|
||||
Fill="{TemplateBinding Foreground}"
|
||||
Data="F1 M 17.4167,32.25L 32.9107,32.25L 38,18L 43.0893,32.25L 58.5833,32.25L 45.6798,41.4944L 51.4583,56L 38,48.0833L 26.125,56L 30.5979,41.7104L 17.4167,32.25 Z "/> -->
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- REGION EDGE LABLE CONTROL -->
|
||||
<!-- REGION EDGE LABLE CONTROL -->
|
||||
<Style TargetType="{x:Type controls:EdgeLabelControl}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type controls:EdgeLabelControl}">
|
||||
<Grid>
|
||||
<Border BorderBrush="Black" BorderThickness="1" Background="White" CornerRadius="8">
|
||||
<ContentPresenter Margin="3"/>
|
||||
<Border Background="White"
|
||||
BorderBrush="Black"
|
||||
BorderThickness="1"
|
||||
CornerRadius="8">
|
||||
<ContentPresenter Margin="3" />
|
||||
</Border>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
||||
<Setter Property="DisplayForSelfLoopedEdges" Value="False"/>
|
||||
<Setter Property="DisplayForSelfLoopedEdges" Value="False" />
|
||||
</Style>
|
||||
<!-- ENDREGION -->
|
||||
<!-- ENDREGION -->
|
||||
|
||||
<!-- REGION VERTEX LABEL CONTROL -->
|
||||
<!-- REGION VERTEX LABEL CONTROL -->
|
||||
<Style TargetType="controls:VertexLabelControl">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="LabelPositionMode" Value="Sides"/>
|
||||
<Setter Property="LabelPositionSide" Value="BottomRight"/>
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Foreground" Value="White" />
|
||||
<Setter Property="LabelPositionMode" Value="Sides" />
|
||||
<Setter Property="LabelPositionSide" Value="BottomRight" />
|
||||
|
||||
<!-- Custom label template body -->
|
||||
<!-- Custom label template body -->
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:VertexLabelControl">
|
||||
<Grid>
|
||||
<ContentPresenter Margin="3"/>
|
||||
<ContentPresenter Margin="3" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<!-- ENDREGION -->
|
||||
<!-- ENDREGION -->
|
||||
</ResourceDictionary>
|
|
@ -1,65 +1,76 @@
|
|||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:ShowcaseApp.WPF"
|
||||
xmlns:controls="http://schemas.panthernet.ru/graphx/">
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="http://schemas.panthernet.ru/graphx/"
|
||||
xmlns:local="clr-namespace:ShowcaseApp.WPF">
|
||||
|
||||
<local:ValueToImageConverter x:Key="ValueToImage"/>
|
||||
|
||||
<!-- VERTEX CONTROL -->
|
||||
<local:ValueToImageConverter x:Key="ValueToImage" />
|
||||
|
||||
<!-- VERTEX CONTROL -->
|
||||
<Style TargetType="{x:Type controls:VertexControl}">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="VertexShape" Value="Circle"/>
|
||||
<Setter Property="ShowLabel" Value="True"/>
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="VertexShape" Value="Circle" />
|
||||
<Setter Property="ShowLabel" Value="True" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type controls:VertexControl}">
|
||||
|
||||
<Grid>
|
||||
<Image Source="{Binding ImageId, Converter={StaticResource ValueToImage}}" Margin="0" Width="80" Stretch="UniformToFill"/>
|
||||
<Image Width="80"
|
||||
Margin="0"
|
||||
Source="{Binding ImageId,
|
||||
Converter={StaticResource ValueToImage}}"
|
||||
Stretch="UniformToFill" />
|
||||
<!-- removed in favor of new attachable vertex label logic
|
||||
<controls:VertexLabelControl x:Name="PART_vertexLabel" Content="{Binding Vertex.Text, RelativeSource={RelativeSource TemplatedParent}}" LabelPositionSide="Bottom" />-->
|
||||
</Grid>
|
||||
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
||||
<!-- VERTEX DRAGGING CONTROL -->
|
||||
<Setter Property="controls:DragBehaviour.IsDragEnabled"
|
||||
Value="True" />
|
||||
<Setter Property="controls:DragBehaviour.UpdateEdgesOnMove"
|
||||
Value="True" />
|
||||
<!-- VERTEX DRAGGING CONTROL -->
|
||||
<Setter Property="controls:DragBehaviour.IsDragEnabled" Value="True" />
|
||||
<Setter Property="controls:DragBehaviour.UpdateEdgesOnMove" Value="True" />
|
||||
</Style>
|
||||
|
||||
<controls:VisibilityToBoolConverter Inverted="True" Not="True" x:Key="BooleanToVisibility"/>
|
||||
<controls:VisibilityToBoolConverter x:Key="BooleanToVisibility"
|
||||
Inverted="True"
|
||||
Not="True" />
|
||||
|
||||
<!-- EDGE CONTROL -->
|
||||
<!-- EDGE CONTROL -->
|
||||
<Style TargetType="{x:Type controls:EdgeControl}">
|
||||
<Setter Property="SelfLoopIndicatorOffset" Value="10,10"/>
|
||||
<Setter Property="SelfLoopIndicatorOffset" Value="10,10" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type controls:EdgeControl}">
|
||||
<Grid>
|
||||
<Path Stroke="#FF976969"
|
||||
<Path x:Name="PART_edgePath"
|
||||
Stroke="#FF976969"
|
||||
StrokeThickness="3"
|
||||
ToolTip="{TemplateBinding ToolTip}"
|
||||
x:Name="PART_edgePath"/>
|
||||
<controls:DefaultEdgePointer NeedRotation="true" x:Name="PART_EdgePointerForTarget" >
|
||||
<Path Data="M0,0.5 L1,1 1,0" Fill="Black" Stretch="Uniform" Width="15" Height="15"/>
|
||||
ToolTip="{TemplateBinding ToolTip}" />
|
||||
<controls:DefaultEdgePointer x:Name="PART_EdgePointerForTarget" NeedRotation="true">
|
||||
<Path Width="15"
|
||||
Height="15"
|
||||
Data="M0,0.5 L1,1 1,0"
|
||||
Fill="Black"
|
||||
Stretch="Uniform" />
|
||||
</controls:DefaultEdgePointer>
|
||||
<Path x:Name="PART_SelfLoopedEdge"
|
||||
Width="10"
|
||||
Height="10"
|
||||
Stretch="Uniform"
|
||||
Fill="Black"
|
||||
<!--<controls:DefaultEdgePointer x:Name="PART_EdgePointerForSource" NeedRotation="true">
|
||||
<Path Width="15"
|
||||
Height="15"
|
||||
Data="M2,0.5 L1,1 1,0"
|
||||
Fill="Red"
|
||||
Stretch="Uniform" />
|
||||
</controls:DefaultEdgePointer>-->
|
||||
<Path x:Name="PART_SelfLoopedEdge"
|
||||
Width="10"
|
||||
Height="10"
|
||||
Data="F1 M 17.4167,32.25L 32.9107,32.25L 38,18L 43.0893,32.25L 58.5833,32.25L 45.6798,41.4944L 51.4583,56L 38,48.0833L 26.125,56L 30.5979,41.7104L 17.4167,32.25 Z "
|
||||
Fill="Black"
|
||||
IsHitTestVisible="True"
|
||||
ToolTip="This vertex has some self looped edges!"
|
||||
Data="F1 M 17.4167,32.25L 32.9107,32.25L 38,18L 43.0893,32.25L 58.5833,32.25L 45.6798,41.4944L 51.4583,56L 38,48.0833L 26.125,56L 30.5979,41.7104L 17.4167,32.25 Z "/>
|
||||
Stretch="Uniform"
|
||||
ToolTip="This vertex has some self looped edges!" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
|
@ -35,15 +35,6 @@
|
|||
<controls:DefaultEdgePointer NeedRotation="true" x:Name="PART_EdgePointerForTarget" >
|
||||
<Path Data="M0,0.5 L1,1 1,0" Fill="{TemplateBinding Foreground}" Stretch="Uniform" Width="10" Height="10"/>
|
||||
</controls:DefaultEdgePointer>
|
||||
<Path x:Name="PART_SelfLoopedEdge"
|
||||
Width="10"
|
||||
Height="10"
|
||||
Stretch="Uniform"
|
||||
Fill="Black"
|
||||
IsHitTestVisible="True"
|
||||
ToolTip="This vertex has some self looped edges!"
|
||||
Data="F1 M 17.4167,32.25L 32.9107,32.25L 38,18L 43.0893,32.25L 58.5833,32.25L 45.6798,41.4944L 51.4583,56L 38,48.0833L 26.125,56L 30.5979,41.7104L 17.4167,32.25 Z "/>
|
||||
<controls:EdgeLabelControl x:Name="PART_edgeLabel" Content="{Binding Edge.ToolTipText, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
|
@ -51,13 +42,21 @@
|
|||
</Style>
|
||||
|
||||
<!--EDGE LABLE CONTROL -->
|
||||
<Style TargetType="{x:Type controls:EdgeLabelControl}">
|
||||
<Style TargetType="{x:Type controls:AttachableEdgeLabelControl}">
|
||||
<Setter Property="LabelVerticalOffset" Value="0"/>
|
||||
<Setter Property="ShowLabel" Value="true"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type controls:EdgeLabelControl}">
|
||||
<TextBlock Text="{TemplateBinding Content}" FontSize="8" FontStyle="Italic" Margin="1" VerticalAlignment="Center"/>
|
||||
<ControlTemplate TargetType="{x:Type controls:AttachableEdgeLabelControl}">
|
||||
<Border BorderBrush="Black" BorderThickness="1" Background="White" CornerRadius="5">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock FontWeight="Bold" FontSize="8" Text="ToolTip: " Foreground="Black" Margin="1"/>
|
||||
<TextBlock FontSize="8" Text="{Binding AttachNode.Edge.ToolTipText}" Foreground="Black" Margin="1"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="DisplayForSelfLoopedEdges" Value="False"/>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
|
@ -1,47 +1,61 @@
|
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="http://schemas.panthernet.ru/graphx/"
|
||||
>
|
||||
xmlns:controls="http://schemas.panthernet.ru/graphx/">
|
||||
|
||||
<Style TargetType="controls:StaticVertexConnectionPoint" x:Shared="False">
|
||||
<Setter Property="Shape" Value="Circle"/>
|
||||
<Style x:Shared="False" TargetType="controls:StaticVertexConnectionPoint">
|
||||
<Setter Property="Shape" Value="Circle" />
|
||||
|
||||
<Setter Property="Content">
|
||||
<Setter.Value>
|
||||
<Path Stroke="{DynamicResource ButtonText}" Data="M 38,0.791664C 58.5496,0.791664 75.2083,17.4504 75.2083,38C 75.2083,58.5496 58.5496,75.2083 38,75.2083C 17.4504,75.2083 0.791662,58.5496 0.791662,38C 0.791662,17.4504 17.4504,0.791664 38,0.791664 Z M 38,5.54166C 20.0738,5.54166 5.54167,20.0738 5.54167,38C 5.54167,55.9262 20.0738,70.4583 38,70.4583C 55.9262,70.4583 70.4583,55.9262 70.4583,38C 70.4583,20.0738 55.9262,5.54166 38,5.54166 Z "
|
||||
Width="10" Height="10" Stretch="Uniform" StrokeThickness="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
<Path Width="10"
|
||||
Height="10"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Data="M 38,0.791664C 58.5496,0.791664 75.2083,17.4504 75.2083,38C 75.2083,58.5496 58.5496,75.2083 38,75.2083C 17.4504,75.2083 0.791662,58.5496 0.791662,38C 0.791662,17.4504 17.4504,0.791664 38,0.791664 Z M 38,5.54166C 20.0738,5.54166 5.54167,20.0738 5.54167,38C 5.54167,55.9262 20.0738,70.4583 38,70.4583C 55.9262,70.4583 70.4583,55.9262 70.4583,38C 70.4583,20.0738 55.9262,5.54166 38,5.54166 Z "
|
||||
Stretch="Uniform"
|
||||
Stroke="{DynamicResource ButtonText}"
|
||||
StrokeThickness="1" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
|
||||
<Style TargetType="{x:Type controls:VertexControl}">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonText}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonText}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type controls:VertexControl}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border BorderThickness="1" BorderBrush="{TemplateBinding Foreground}" Background="{DynamicResource ButtonBackgroundPressed}" Grid.Column="1" CornerRadius="5" Width="120">
|
||||
<ContentPresenter Content="{TemplateBinding Vertex}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||
<StackPanel Name="PART_vcproot"
|
||||
Grid.Column="0"
|
||||
Orientation="Vertical">
|
||||
<Border Margin="2,2,0,2" Padding="0">
|
||||
<controls:StaticVertexConnectionPoint Id="1" />
|
||||
</Border>
|
||||
<Border Margin="2,2,0,2" Padding="0">
|
||||
<controls:StaticVertexConnectionPoint Id="2" />
|
||||
</Border>
|
||||
</StackPanel>
|
||||
<Border Grid.Column="1"
|
||||
Width="120"
|
||||
Background="{DynamicResource ButtonBackgroundPressed}"
|
||||
BorderBrush="{TemplateBinding Foreground}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="5">
|
||||
<ContentPresenter HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Content="{TemplateBinding Vertex}" />
|
||||
</Border>
|
||||
<StackPanel Orientation="Vertical" Grid.Column="0" Name="PART_vcproot">
|
||||
<Border Padding="0" Margin="2,2,0,2">
|
||||
<controls:StaticVertexConnectionPoint Id="1"/>
|
||||
<StackPanel Grid.Column="2" Orientation="Vertical">
|
||||
<Border Margin="0,2,2,2" Padding="0">
|
||||
<controls:StaticVertexConnectionPoint Id="3" />
|
||||
</Border>
|
||||
<Border Padding="0" Margin="2,2,0,2">
|
||||
<controls:StaticVertexConnectionPoint Id="2"/>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Vertical" Grid.Column="2">
|
||||
<Border Padding="0" Margin="0,2,2,2">
|
||||
<controls:StaticVertexConnectionPoint Id="3"/>
|
||||
</Border>
|
||||
<Border Padding="0" Margin="0,2,2,2">
|
||||
<controls:StaticVertexConnectionPoint Id="4"/>
|
||||
<Border Margin="0,2,2,2" Padding="0">
|
||||
<controls:StaticVertexConnectionPoint Id="4" />
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
@ -51,16 +65,20 @@
|
|||
</Style>
|
||||
|
||||
<Style TargetType="{x:Type controls:EdgeControl}">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonText}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonText}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type controls:EdgeControl}">
|
||||
<Grid>
|
||||
<Path Stroke="{TemplateBinding Foreground}"
|
||||
StrokeThickness="2"
|
||||
x:Name="PART_edgePath"/>
|
||||
<controls:DefaultEdgePointer NeedRotation="true" x:Name="PART_EdgePointerForTarget" >
|
||||
<Path Data="M0,0.5 L1,1 1,0" Fill="{TemplateBinding Foreground}" Stretch="Uniform" Width="10" Height="10"/>
|
||||
<Path x:Name="PART_edgePath"
|
||||
Stroke="{TemplateBinding Foreground}"
|
||||
StrokeThickness="2" />
|
||||
<controls:DefaultEdgePointer x:Name="PART_EdgePointerForTarget" NeedRotation="true">
|
||||
<Path Width="10"
|
||||
Height="10"
|
||||
Data="M0,0.5 L1,1 1,0"
|
||||
Fill="{TemplateBinding Foreground}"
|
||||
Stretch="Uniform" />
|
||||
</controls:DefaultEdgePointer>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
|
|
|
@ -85,7 +85,7 @@ namespace SimpleGraph
|
|||
|
||||
//This method sets edges arrows visibility. It is also applied to all edges in Area.EdgesList. You can also set property for
|
||||
//each edge individually using property, for ex: Area.EdgesList[0].ShowArrows = true;
|
||||
Area.ShowAllEdgesArrows(true);
|
||||
Area.ShowAllEdgesArrows(false);
|
||||
|
||||
//This method sets edges labels visibility. It is also applied to all edges in Area.EdgesList. You can also set property for
|
||||
//each edge individually using property, for ex: Area.EdgesList[0].ShowLabel = true;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<Application
|
||||
x:Class="METRO.SimpleGraph.App"
|
||||
x:Class="UAP.SimpleGraph.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
>
|
|
@ -6,7 +6,7 @@ using Windows.UI.Xaml.Controls;
|
|||
|
||||
// The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=234227
|
||||
|
||||
namespace METRO.SimpleGraph
|
||||
namespace UAP.SimpleGraph
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides application-specific behavior to supplement the default Application class.
|
До Ширина: | Высота: | Размер: 338 B После Ширина: | Высота: | Размер: 338 B |
До Ширина: | Высота: | Размер: 475 B После Ширина: | Высота: | Размер: 475 B |
До Ширина: | Высота: | Размер: 918 B После Ширина: | Высота: | Размер: 918 B |
До Ширина: | Высота: | Размер: 174 B После Ширина: | Высота: | Размер: 174 B |
До Ширина: | Высота: | Размер: 189 B После Ширина: | Высота: | Размер: 189 B |
До Ширина: | Высота: | Размер: 167 B После Ширина: | Высота: | Размер: 167 B |
До Ширина: | Высота: | Размер: 48 KiB После Ширина: | Высота: | Размер: 48 KiB |
До Ширина: | Высота: | Размер: 189 B После Ширина: | Высота: | Размер: 189 B |
До Ширина: | Высота: | Размер: 338 B После Ширина: | Высота: | Размер: 338 B |
До Ширина: | Высота: | Размер: 89 KiB После Ширина: | Высота: | Размер: 89 KiB |
До Ширина: | Высота: | Размер: 22 KiB После Ширина: | Высота: | Размер: 22 KiB |
До Ширина: | Высота: | Размер: 93 KiB После Ширина: | Высота: | Размер: 93 KiB |
До Ширина: | Высота: | Размер: 336 KiB После Ширина: | Высота: | Размер: 336 KiB |
До Ширина: | Высота: | Размер: 22 KiB После Ширина: | Высота: | Размер: 22 KiB |
До Ширина: | Высота: | Размер: 27 KiB После Ширина: | Высота: | Размер: 27 KiB |
До Ширина: | Высота: | Размер: 22 KiB После Ширина: | Высота: | Размер: 22 KiB |
До Ширина: | Высота: | Размер: 11 KiB После Ширина: | Высота: | Размер: 11 KiB |
До Ширина: | Высота: | Размер: 59 KiB После Ширина: | Высота: | Размер: 59 KiB |
До Ширина: | Высота: | Размер: 18 KiB После Ширина: | Высота: | Размер: 18 KiB |
До Ширина: | Высота: | Размер: 18 KiB После Ширина: | Высота: | Размер: 18 KiB |
|
@ -0,0 +1,109 @@
|
|||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls1="using:GraphX.Controls">
|
||||
|
||||
<Style TargetType="controls1:VertexControl">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls1:VertexControl">
|
||||
<Grid>
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<Ellipse Name="bigEllipse" Width="{Binding VisualDiameter}" Height="{Binding VisualDiameter}"
|
||||
Stroke="Gray" StrokeThickness="{Binding VisualOuterRingThickness}" Fill="#3771FD" RenderTransformOrigin=".5,.5">
|
||||
<Ellipse.RenderTransform>
|
||||
<CompositeTransform CenterX=".5" CenterY=".5"/>
|
||||
</Ellipse.RenderTransform>
|
||||
</Ellipse>
|
||||
<Ellipse Name="smallEllipse" Width="{Binding VisualInnerDiameter}" Height="{Binding VisualInnerDiameter}"
|
||||
Stroke="Transparent" StrokeThickness="0" Fill="#3DFF98" RenderTransformOrigin=".5,.5">
|
||||
<Ellipse.RenderTransform>
|
||||
<CompositeTransform CenterX=".5" CenterY=".5"/>
|
||||
</Ellipse.RenderTransform>
|
||||
</Ellipse>
|
||||
<controls1:VertexLabelControl x:Name="PART_vertexLabel" Content="{Binding LabelText}" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="controls1:EdgeControl">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls1:EdgeControl">
|
||||
<Grid>
|
||||
<Path x:Name="PART_edgePath"
|
||||
StrokeThickness="{Binding VisualEdgeThickness}"
|
||||
ToolTipService.ToolTip="{TemplateBinding ToolTipService.ToolTip}"
|
||||
Opacity="{Binding VisualEdgeTransparency}">
|
||||
<Path.Stroke>
|
||||
<SolidColorBrush Color="{Binding VisualColor}"/>
|
||||
</Path.Stroke>
|
||||
</Path>
|
||||
|
||||
<controls1:DefaultEdgePointer NeedRotation="true" x:Name="PART_EdgePointerForTarget" >
|
||||
<Path Data="M0,0.5 L1,1 1,0" Fill="Yellow" Stretch="Uniform" Width="15" Height="15"/>
|
||||
</controls1:DefaultEdgePointer>
|
||||
|
||||
<Path x:Name="PART_SelfLoopedEdge"
|
||||
Width="10"
|
||||
Height="10"
|
||||
Stretch="Uniform"
|
||||
Fill="{TemplateBinding Foreground}"
|
||||
Data="F1 M 17.4167,32.25L 32.9107,32.25L 38,18L 43.0893,32.25L 58.5833,32.25L 45.6798,41.4944L 51.4583,56L 38,48.0833L 26.125,56L 30.5979,41.7104L 17.4167,32.25 Z "/>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
||||
</Style>
|
||||
|
||||
<!--EDGE LABLE CONTROL -->
|
||||
<Style TargetType="controls1:AttachableEdgeLabelControl">
|
||||
<Setter Property="ShowLabel" Value="True"/>
|
||||
<Setter Property="AlignToEdge" Value="True"/>
|
||||
<Setter Property="LabelVerticalOffset" Value="10"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="Opacity" Value="{Binding AttachNode.Edge.VisualEdgeTransparency}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls1:AttachableEdgeLabelControl">
|
||||
<Grid>
|
||||
<ContentPresenter Margin="3" Content="{Binding AttachNode.Edge.Text}"/>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="DisplayForSelfLoopedEdges" Value="False"/>
|
||||
</Style>
|
||||
|
||||
|
||||
<!--VERTEX LABEL CONTROL -->
|
||||
<Style TargetType="controls1:VertexLabelControl">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="LabelPositionMode" Value="Sides"/>
|
||||
<Setter Property="LabelPositionSide" Value="BottomRight"/>
|
||||
<Setter Property="FontSize" Value="10" />
|
||||
<Setter Property="Angle" Value="-45"></Setter>
|
||||
|
||||
<!-- Custom label template body -->
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls1:VertexLabelControl">
|
||||
<Grid>
|
||||
<ContentPresenter Margin="3" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
|
@ -163,14 +163,11 @@
|
|||
<controls1:DefaultEdgePointer x:Name="PART_EdgePointerForTarget" Opacity="239">
|
||||
<Path Data="M0,0.5 L1,1 1,0" Fill="Yellow" Stretch="Uniform" Width="15" Height="15"/>
|
||||
</controls1:DefaultEdgePointer>
|
||||
|
||||
<controls1:EdgeLabelControl x:Name="PART_edgeLabel" Content="{Binding Edge.Text, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
||||
<Setter Property="LabelVerticalOffset" Value="0"/>
|
||||
<Setter Property="MinWidth"
|
||||
Value="1" />
|
||||
<Setter Property="MinHeight"
|
||||
|
@ -185,19 +182,23 @@
|
|||
<!-- ENDREGION -->
|
||||
|
||||
<!-- REGION LABLE CONTROLS -->
|
||||
<Style TargetType="controls1:EdgeLabelControl">
|
||||
<Setter Property="DisplayForSelfLoopedEdges" Value="False"/>
|
||||
|
||||
<Style TargetType="controls1:AttachableEdgeLabelControl">
|
||||
<Setter Property="ShowLabel" Value="True"/>
|
||||
<Setter Property="LabelVerticalOffset" Value="10"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="Opacity" Value="{Binding AttachNode.Edge.VisualEdgeTransparency}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls1:EdgeLabelControl">
|
||||
<Grid>
|
||||
<ControlTemplate TargetType="controls1:AttachableEdgeLabelControl">
|
||||
<Border BorderBrush="Black" BorderThickness="1" Background="LightCoral" CornerRadius="8">
|
||||
<ContentPresenter Margin="3"/>
|
||||
<ContentPresenter Margin="3" Content="{Binding AttachNode.Edge.Text}"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="DisplayForSelfLoopedEdges" Value="False"/>
|
||||
</Style>
|
||||
|
||||
<!--VERTEX LABEL CONTROL -->
|
|
@ -1,16 +1,15 @@
|
|||
<Page
|
||||
x:Class="METRO.SimpleGraph.MainPage"
|
||||
x:Class="UAP.SimpleGraph.MainPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:METRO.SimpleGraph"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:controls1="using:GraphX.Controls"
|
||||
UseLayoutRounding="True"
|
||||
xmlns:graphx="http://schemas.panthernet.ru/graphx/"
|
||||
xmlns:models="using:UAP.SimpleGraph.Models"
|
||||
mc:Ignorable="d" >
|
||||
|
||||
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
|
||||
<Grid Background="Black">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
|
@ -18,7 +17,7 @@
|
|||
|
||||
|
||||
<controls1:ZoomControl x:Name="zc" ViewFinderVisibility="Collapsed" Grid.Row="1">
|
||||
<local:GraphAreaExample x:Name="graph" />
|
||||
<models:GraphAreaExample x:Name="graph" />
|
||||
</controls1:ZoomControl>
|
||||
|
||||
<Grid Grid.Row="0" Margin="5">
|
|
@ -1,6 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
|
@ -12,10 +11,11 @@ using GraphX.Controls.Models;
|
|||
using GraphX.PCL.Common.Enums;
|
||||
using GraphX.PCL.Logic.Algorithms.LayoutAlgorithms;
|
||||
using GraphX.PCL.Logic.Algorithms.OverlapRemoval;
|
||||
using UAP.SimpleGraph.Models;
|
||||
|
||||
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
|
||||
|
||||
namespace METRO.SimpleGraph
|
||||
namespace UAP.SimpleGraph
|
||||
{
|
||||
/// <summary>
|
||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
|
@ -1,11 +1,12 @@
|
|||
<Page
|
||||
x:Class="METRO.SimpleGraph.MainPageDebug"
|
||||
x:Class="UAP.SimpleGraph.MainPageDebug"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:METRO.SimpleGraph"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:controls1="using:GraphX.Controls"
|
||||
xmlns:models="using:UAP.SimpleGraph.Models"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
|
||||
|
@ -16,7 +17,7 @@
|
|||
|
||||
|
||||
<controls1:ZoomControl x:Name="zc" ViewFinderVisibility="Collapsed" Grid.Row="1">
|
||||
<local:GraphAreaExample x:Name="graph" />
|
||||
<models:GraphAreaExample x:Name="graph" />
|
||||
</controls1:ZoomControl>
|
||||
|
||||
<Grid Grid.Row="0" Margin="5">
|
|
@ -4,19 +4,17 @@ using System.Diagnostics;
|
|||
using System.Linq;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Input;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
using GraphX.Controls;
|
||||
using GraphX.Controls.Animations;
|
||||
using GraphX.Controls.Models;
|
||||
using GraphX.PCL.Common.Enums;
|
||||
using GraphX.PCL.Logic.Algorithms.LayoutAlgorithms;
|
||||
using GraphX.PCL.Logic.Algorithms.OverlapRemoval;
|
||||
using METRO.SimpleGraph.Models;
|
||||
using UAP.SimpleGraph.Models;
|
||||
|
||||
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
|
||||
|
||||
namespace METRO.SimpleGraph
|
||||
namespace UAP.SimpleGraph
|
||||
{
|
||||
/// <summary>
|
||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
|
@ -1,13 +1,11 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using GraphX;
|
||||
using GraphX.Measure;
|
||||
using GraphX.PCL.Common.Interfaces;
|
||||
using GraphX.PCL.Logic.Algorithms.EdgeRouting;
|
||||
using METRO.SimpleGraph;
|
||||
|
||||
namespace InteractiveGraph.Models
|
||||
namespace UAP.SimpleGraph.Models
|
||||
{
|
||||
public class CurvedEr: EdgeRoutingAlgorithmBase<DataVertex, DataEdge, GraphExample>
|
||||
{
|
|
@ -1,6 +1,6 @@
|
|||
using GraphX.PCL.Logic.Algorithms.EdgeRouting;
|
||||
|
||||
namespace InteractiveGraph.Models
|
||||
namespace UAP.SimpleGraph.Models
|
||||
{
|
||||
public class CurvedErParameters: EdgeRoutingParameters
|
||||
{
|
|
@ -1,8 +1,7 @@
|
|||
using System.ComponentModel;
|
||||
using GraphX;
|
||||
using GraphX.PCL.Common.Models;
|
||||
|
||||
namespace METRO.SimpleGraph
|
||||
namespace UAP.SimpleGraph.Models
|
||||
{
|
||||
/* DataEdge is the data class for the edges. It contains all custom edge data specified by the user.
|
||||
* This class also must be derived from EdgeBase class that provides properties and methods mandatory for
|
|
@ -1,8 +1,7 @@
|
|||
using System.ComponentModel;
|
||||
using GraphX;
|
||||
using GraphX.PCL.Common.Models;
|
||||
|
||||
namespace METRO.SimpleGraph
|
||||
namespace UAP.SimpleGraph.Models
|
||||
{
|
||||
/* DataVertex is the data class for the vertices. It contains all custom vertex data specified by the user.
|
||||
* This class also must be derived from VertexBase that provides properties and methods mandatory for
|
|
@ -1,4 +1,4 @@
|
|||
namespace METRO.SimpleGraph.Models
|
||||
namespace UAP.SimpleGraph.Models
|
||||
{
|
||||
public enum DebugItems
|
||||
{
|
|
@ -1,7 +1,7 @@
|
|||
using GraphX.PCL.Logic.Models;
|
||||
using QuickGraph;
|
||||
|
||||
namespace METRO.SimpleGraph
|
||||
namespace UAP.SimpleGraph.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Logics core object which contains all algorithms and logic settings
|
|
@ -1,8 +1,7 @@
|
|||
using GraphX;
|
||||
using GraphX.Controls;
|
||||
using QuickGraph;
|
||||
|
||||
namespace METRO.SimpleGraph
|
||||
namespace UAP.SimpleGraph.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// This is custom GraphArea representation using custom data types.
|
|
@ -1,6 +1,6 @@
|
|||
using QuickGraph;
|
||||
|
||||
namespace METRO.SimpleGraph
|
||||
namespace UAP.SimpleGraph.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// This is our custom data graph derived from BidirectionalGraph class using custom data types.
|
|
@ -1,13 +1,12 @@
|
|||
using Windows.Foundation;
|
||||
using System;
|
||||
using Windows.Foundation;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Media;
|
||||
using Windows.UI.Xaml.Media.Animation;
|
||||
using GraphX;
|
||||
using System;
|
||||
using GraphX.Controls;
|
||||
using GraphX.Controls.Animations;
|
||||
|
||||
namespace METRO.SimpleGraph
|
||||
namespace UAP.SimpleGraph.Models
|
||||
{
|
||||
public sealed class MouseOverAnimation : IBidirectionalControlAnimation
|
||||
{
|
|
@ -3,7 +3,7 @@
|
|||
<Identity Name="e80be425-9029-4724-abf0-e177effb0522" Publisher="CN=panthernet" Version="1.0.0.0" />
|
||||
<mp:PhoneIdentity PhoneProductId="e80be425-9029-4724-abf0-e177effb0522" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
|
||||
<Properties>
|
||||
<DisplayName>UWA.SimpleGraph</DisplayName>
|
||||
<DisplayName>UAP.SimpleGraph</DisplayName>
|
||||
<PublisherDisplayName>panth</PublisherDisplayName>
|
||||
<Logo>Assets/50.png</Logo>
|
||||
</Properties>
|
||||
|
@ -14,8 +14,8 @@
|
|||
<Resource Language="x-generate" />
|
||||
</Resources>
|
||||
<Applications>
|
||||
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="METRO.SimpleGraph.App">
|
||||
<uap:VisualElements DisplayName="UWA.SimpleGraph" Square150x150Logo="Assets/150.png" Square44x44Logo="Assets/44.png" Description="UWA.SimpleGraph" BackgroundColor="transparent">
|
||||
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="UAP.SimpleGraph.App">
|
||||
<uap:VisualElements DisplayName="UAP.SimpleGraph" Square150x150Logo="Assets/150.png" Square44x44Logo="Assets/44.png" Description="UAP.SimpleGraph" BackgroundColor="transparent">
|
||||
<uap:InitialRotationPreference>
|
||||
<uap:Rotation Preference="portrait" />
|
||||
<uap:Rotation Preference="landscape" />
|
|
@ -7,11 +7,11 @@
|
|||
<ProjectGuid>{51C7122B-AAD1-4C49-B2E9-1B09B367952F}</ProjectGuid>
|
||||
<OutputType>AppContainerExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>METRO.SimpleGraph</RootNamespace>
|
||||
<AssemblyName>UWA.SimpleGraph</AssemblyName>
|
||||
<RootNamespace>UAP.SimpleGraph</RootNamespace>
|
||||
<AssemblyName>UAP.SimpleGraph</AssemblyName>
|
||||
<DefaultLanguage>en-US</DefaultLanguage>
|
||||
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
|
||||
<TargetPlatformVersion>10.0.10586.0</TargetPlatformVersion>
|
||||
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.14393.0</TargetPlatformVersion>
|
||||
<TargetPlatformMinVersion>10.0.10586.0</TargetPlatformMinVersion>
|
||||
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
|
@ -91,47 +91,26 @@
|
|||
<ItemGroup>
|
||||
<!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
|
||||
<None Include="project.json" />
|
||||
<None Include="UWA.SimpleGraph_TemporaryKey.pfx" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\METRO.SimpleGraph\MainPage.xaml.cs">
|
||||
<Link>MainPage.xaml.cs</Link>
|
||||
<DependentUpon>MainPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="..\METRO.SimpleGraph\MainPageDebug.xaml.cs">
|
||||
<Link>MainPageDebug.xaml.cs</Link>
|
||||
<DependentUpon>MainPageDebug.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="..\METRO.SimpleGraph\Models\CurvedEr.cs">
|
||||
<Link>Models\CurvedEr.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\METRO.SimpleGraph\Models\CurvedErParameters.cs">
|
||||
<Link>Models\CurvedErParameters.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\METRO.SimpleGraph\Models\DataEdge.cs">
|
||||
<Link>Models\DataEdge.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\METRO.SimpleGraph\Models\DataVertex.cs">
|
||||
<Link>Models\DataVertex.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\METRO.SimpleGraph\Models\DebugItems.cs">
|
||||
<Link>Models\DebugItems.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\METRO.SimpleGraph\Models\GraphAreaExample.cs">
|
||||
<Link>Models\GraphAreaExample.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\METRO.SimpleGraph\Models\GraphExample.cs">
|
||||
<Link>Models\GraphExample.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\METRO.SimpleGraph\Models\GXLogicCoreExample.cs">
|
||||
<Link>Models\GXLogicCoreExample.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\METRO.SimpleGraph\Models\MouseOverScaleAnimation.cs">
|
||||
<Link>Models\MouseOverScaleAnimation.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MainPage.xaml.cs">
|
||||
<DependentUpon>MainPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MainPageDebug.xaml.cs">
|
||||
<DependentUpon>MainPageDebug.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Models\CurvedEr.cs" />
|
||||
<Compile Include="Models\CurvedErParameters.cs" />
|
||||
<Compile Include="Models\DataEdge.cs" />
|
||||
<Compile Include="Models\DataVertex.cs" />
|
||||
<Compile Include="Models\DebugItems.cs" />
|
||||
<Compile Include="Models\GraphAreaExample.cs" />
|
||||
<Compile Include="Models\GraphExample.cs" />
|
||||
<Compile Include="Models\GXLogicCoreExample.cs" />
|
||||
<Compile Include="Models\MouseOverScaleAnimation.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -140,37 +119,20 @@
|
|||
</AppxManifest>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="..\METRO.SimpleGraph\Assets\Logo.png">
|
||||
<Link>Assets\Logo.png</Link>
|
||||
</Content>
|
||||
<Content Include="..\METRO.SimpleGraph\Assets\MidLogo.png">
|
||||
<Link>Assets\MidLogo.png</Link>
|
||||
</Content>
|
||||
<Content Include="..\METRO.SimpleGraph\Assets\play.png">
|
||||
<Link>Assets\play.png</Link>
|
||||
</Content>
|
||||
<Content Include="..\METRO.SimpleGraph\Assets\refresh.png">
|
||||
<Link>Assets\refresh.png</Link>
|
||||
</Content>
|
||||
<Content Include="..\METRO.SimpleGraph\Assets\SmallLogo.png">
|
||||
<Link>Assets\SmallLogo.png</Link>
|
||||
</Content>
|
||||
<Content Include="..\METRO.SimpleGraph\Assets\SplashScreen.png">
|
||||
<Link>Assets\SplashScreen.png</Link>
|
||||
</Content>
|
||||
<Content Include="..\METRO.SimpleGraph\Assets\StoreLogo.png">
|
||||
<Link>Assets\StoreLogo.png</Link>
|
||||
</Content>
|
||||
<Content Include="..\METRO.SimpleGraph\Assets\tr_grren.png">
|
||||
<Link>Assets\tr_grren.png</Link>
|
||||
</Content>
|
||||
<Content Include="..\METRO.SimpleGraph\Assets\tr_red.png">
|
||||
<Link>Assets\tr_red.png</Link>
|
||||
</Content>
|
||||
<Content Include="Assets\Logo.png" />
|
||||
<Content Include="Assets\Logo.scale-100.png" />
|
||||
<Content Include="Assets\Logo.scale-200.png" />
|
||||
<Content Include="Assets\MidLogo.png" />
|
||||
<Content Include="Assets\newlogo_big.png" />
|
||||
<Content Include="Assets\play.png" />
|
||||
<Content Include="Assets\refresh.png" />
|
||||
<Content Include="Assets\SmallLogo.png" />
|
||||
<Content Include="Assets\SplashScreen.png" />
|
||||
<Content Include="Assets\SplashScreen.scale-100.png" />
|
||||
<Content Include="Assets\SplashScreen.scale-200.png" />
|
||||
<Content Include="Assets\StoreLogo.png" />
|
||||
<Content Include="Assets\tr_grren.png" />
|
||||
<Content Include="Assets\tr_red.png" />
|
||||
<Content Include="Properties\Default.rd.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -178,37 +140,28 @@
|
|||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Page Include="..\METRO.SimpleGraph\Common\StandardStyles.xaml">
|
||||
<Link>Common\StandardStyles.xaml</Link>
|
||||
<Page Include="Common\StandardStyles.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="..\METRO.SimpleGraph\Common\templates.xaml">
|
||||
<Link>Common\templates.xaml</Link>
|
||||
<Page Include="Common\templates.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="..\METRO.SimpleGraph\Common\templates2.xaml">
|
||||
<Link>Common\templates2.xaml</Link>
|
||||
<Page Include="Common\templates2.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="..\METRO.SimpleGraph\MainPage.xaml">
|
||||
<Link>MainPage.xaml</Link>
|
||||
<Page Include="MainPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="..\METRO.SimpleGraph\MainPageDebug.xaml">
|
||||
<Link>MainPageDebug.xaml</Link>
|
||||
<Page Include="MainPageDebug.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\GraphX.METRO.Controls\GraphX.METRO.Controls.csproj">
|
||||
<Project>{66f33708-c1c7-4385-8235-7201784d184c}</Project>
|
||||
<Name>GraphX.METRO.Controls</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\GraphX.PCL.Common\GraphX.PCL.Common.csproj">
|
||||
<Project>{3644d44b-dec0-4b65-bba0-c68e34821aae}</Project>
|
||||
<Name>GraphX.PCL.Common</Name>
|
||||
|
@ -217,6 +170,10 @@
|
|||
<Project>{a30d218b-aaa4-483a-99f7-eaeb1b8b4610}</Project>
|
||||
<Name>GraphX.PCL.Logic</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\GraphX.UAP.Controls\GraphX.UAP.Controls.csproj">
|
||||
<Project>{4bebc41e-2710-4613-80b1-198e08d10619}</Project>
|
||||
<Name>GraphX.UAP.Controls</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' ">
|
||||
|
@ -226,7 +183,8 @@
|
|||
<SignAssembly>true</SignAssembly>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<AssemblyOriginatorKeyFile>UWA.SimpleGraph_TemporaryKey.pfx</AssemblyOriginatorKeyFile>
|
||||
<AssemblyOriginatorKeyFile>
|
||||
</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
|
||||
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
|
||||
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">D:\Projects\GraphX for.NET\GraphX\Examples\UAP.SimpleGraph\project.lock.json</ProjectAssetsFile>
|
||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
|
||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\panthernet\.nuget\packages\;C:\Program Files (x86)\Microsoft SDKs\NuGetPackagesFallback\</NuGetPackageFolders>
|
||||
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">ProjectJson</NuGetProjectStyle>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">4.6.0</NuGetToolVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
||||
</PropertyGroup>
|
||||
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-x86\1.7.0\build\Microsoft.Net.Native.SharedLibrary-x86.props" Condition="Exists('$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-x86\1.7.0\build\Microsoft.Net.Native.SharedLibrary-x86.props')" />
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-x64\1.7.0\build\Microsoft.Net.Native.SharedLibrary-x64.props" Condition="Exists('$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-x64\1.7.0\build\Microsoft.Net.Native.SharedLibrary-x64.props')" />
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-arm\1.7.0\build\Microsoft.Net.Native.SharedLibrary-arm.props" Condition="Exists('$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-arm\1.7.0\build\Microsoft.Net.Native.SharedLibrary-arm.props')" />
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.net.native.compiler\1.7.3\build\Microsoft.Net.Native.Compiler.props" Condition="Exists('$(NuGetPackageRoot)microsoft.net.native.compiler\1.7.3\build\Microsoft.Net.Native.Compiler.props')" />
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
||||
</PropertyGroup>
|
||||
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-x86\1.7.0\build\Microsoft.Net.Native.SharedLibrary-x86.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-x86\1.7.0\build\Microsoft.Net.Native.SharedLibrary-x86.targets')" />
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-x64\1.7.0\build\Microsoft.Net.Native.SharedLibrary-x64.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-x64\1.7.0\build\Microsoft.Net.Native.SharedLibrary-x64.targets')" />
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-arm\1.7.0\build\Microsoft.Net.Native.SharedLibrary-arm.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.net.native.sharedlibrary-arm\1.7.0\build\Microsoft.Net.Native.SharedLibrary-arm.targets')" />
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.net.native.compiler\1.7.3\build\Microsoft.Net.Native.Compiler.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.net.native.compiler\1.7.3\build\Microsoft.Net.Native.Compiler.targets')" />
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.UniversalWindowsPlatform": "5.1.0",
|
||||
"Microsoft.NETCore.UniversalWindowsPlatform": "6.0.6",
|
||||
"QuickGraphPCL": "3.6.61114.2"
|
||||
},
|
||||
"frameworks": {
|
||||
"uap10.0": {}
|
||||
"uap10.0.10586": {}
|
||||
},
|
||||
"runtimes": {
|
||||
"win10-arm": {},
|
|
@ -1,14 +0,0 @@
|
|||
<Application
|
||||
x:Class="METRO.SimpleGraph.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
RequestedTheme="Dark">
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Common/StandardStyles.xaml"/>
|
||||
<ResourceDictionary Source="Common/templates.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
</Application>
|
|
@ -1,96 +0,0 @@
|
|||
using System;
|
||||
using Windows.ApplicationModel;
|
||||
using Windows.ApplicationModel.Activation;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
|
||||
namespace METRO.SimpleGraph
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides application-specific behavior to supplement the default Application class.
|
||||
/// </summary>
|
||||
sealed partial class App : Application
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes the singleton application object. This is the first line of authored code
|
||||
/// executed, and as such is the logical equivalent of main() or WinMain().
|
||||
/// </summary>
|
||||
public App()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
this.Suspending += OnSuspending;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when the application is launched normally by the end user. Other entry points
|
||||
/// will be used such as when the application is launched to open a specific file.
|
||||
/// </summary>
|
||||
/// <param name="e">Details about the launch request and process.</param>
|
||||
protected override void OnLaunched(LaunchActivatedEventArgs e)
|
||||
{
|
||||
#if DEBUG
|
||||
if (System.Diagnostics.Debugger.IsAttached)
|
||||
{
|
||||
this.DebugSettings.EnableFrameRateCounter = true;
|
||||
}
|
||||
#endif
|
||||
Frame rootFrame = Window.Current.Content as Frame;
|
||||
|
||||
// Do not repeat app initialization when the Window already has content,
|
||||
// just ensure that the window is active
|
||||
if (rootFrame == null)
|
||||
{
|
||||
// Create a Frame to act as the navigation context and navigate to the first page
|
||||
rootFrame = new Frame();
|
||||
|
||||
rootFrame.NavigationFailed += OnNavigationFailed;
|
||||
|
||||
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
|
||||
{
|
||||
//TODO: Load state from previously suspended application
|
||||
}
|
||||
|
||||
// Place the frame in the current Window
|
||||
Window.Current.Content = rootFrame;
|
||||
}
|
||||
|
||||
if (e.PrelaunchActivated == false)
|
||||
{
|
||||
if (rootFrame.Content == null)
|
||||
{
|
||||
// When the navigation stack isn't restored navigate to the first page,
|
||||
// configuring the new page by passing required information as a navigation
|
||||
// parameter
|
||||
rootFrame.Navigate(typeof(MainPage), e.Arguments);
|
||||
}
|
||||
// Ensure the current window is active
|
||||
Window.Current.Activate();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when Navigation to a certain page fails
|
||||
/// </summary>
|
||||
/// <param name="sender">The Frame which failed navigation</param>
|
||||
/// <param name="e">Details about the navigation failure</param>
|
||||
void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
|
||||
{
|
||||
throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when application execution is being suspended. Application state is saved
|
||||
/// without knowing whether the application will be terminated or resumed with the contents
|
||||
/// of memory still intact.
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the suspend request.</param>
|
||||
/// <param name="e">Details about the suspend request.</param>
|
||||
private void OnSuspending(object sender, SuspendingEventArgs e)
|
||||
{
|
||||
var deferral = e.SuspendingOperation.GetDeferral();
|
||||
//TODO: Save application state and stop any background activity
|
||||
deferral.Complete();
|
||||
}
|
||||
}
|
||||
}
|
Двоичные данные
Examples/UWA.SimpleGraph/UWA.SimpleGraph_TemporaryKey.pfx
|
@ -57,7 +57,6 @@
|
|||
<controls:DefaultEdgePointer NeedRotation="true" x:Name="PART_EdgePointerForTarget" >
|
||||
<Path Data="M0,0.5 L1,1 1,0" Fill="Black" Stretch="Uniform" Width="15" Height="15"/>
|
||||
</controls:DefaultEdgePointer>
|
||||
<controls:EdgeLabelControl x:Name="PART_edgeLabel" Content="{Binding Edge.ToolTipText, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
|
@ -86,23 +85,18 @@
|
|||
</Style>
|
||||
|
||||
<!--EDGE LABLE CONTROL -->
|
||||
<Style TargetType="{x:Type controls:EdgeLabelControl}">
|
||||
<Style TargetType="{x:Type controls:AttachableEdgeLabelControl}">
|
||||
<Setter Property="ShowLabel" Value="True"/>
|
||||
<Setter Property="LabelVerticalOffset" Value="0"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type controls:EdgeLabelControl}">
|
||||
<Grid>
|
||||
<Border BorderBrush="Black" BorderThickness="1" Background="LightCoral" CornerRadius="8">
|
||||
<ContentPresenter Margin="3"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
<ControlTemplate TargetType="{x:Type controls:AttachableEdgeLabelControl}">
|
||||
<Border BorderBrush="Black" BorderThickness="1" Background="LightCoral" CornerRadius="8">
|
||||
<ContentPresenter Margin="3"/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="RenderTransform">
|
||||
<Setter.Value>
|
||||
<RotateTransform CenterX="0.5" CenterY="0.5" Angle="{Binding RelativeSource={RelativeSource AncestorType=controls:EdgeLabelControl} , Path=Angle}"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
||||
<Setter Property="DisplayForSelfLoopedEdges" Value="False"/>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.25420.1
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.27130.2027
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{D9664367-2C2C-46B2-81A6-26CDCD087B29}"
|
||||
EndProject
|
||||
|
@ -40,13 +40,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GraphX.PCL.Logic", "GraphX.
|
|||
EndProject
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WindowsDesktop_VB.NET_WinForms_Example", "Examples\WindowsDesktop_VB.NET_WinForms_Example\WindowsDesktop_VB.NET_WinForms_Example.vbproj", "{C2718C9A-6455-43F6-835A-26B788824F53}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GraphX.METRO.Controls", "GraphX.METRO.Controls\GraphX.METRO.Controls.csproj", "{66F33708-C1C7-4385-8235-7201784D184C}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "METRO.SimpleGraph", "Examples\METRO.SimpleGraph\METRO.SimpleGraph.csproj", "{44841666-C547-4874-9BC9-B34D2A1FA6D8}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShowcaseApp.WPF", "Examples\ShowcaseApp.WPF\ShowcaseApp.WPF.csproj", "{C054C423-7284-46A6-9738-B82E2237E9C7}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UWA.SimpleGraph", "Examples\UWA.SimpleGraph\UWA.SimpleGraph.csproj", "{51C7122B-AAD1-4C49-B2E9-1B09B367952F}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GraphX.UAP.Controls", "GraphX.UAP.Controls\GraphX.UAP.Controls.csproj", "{4BEBC41E-2710-4613-80B1-198E08D10619}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UAP.SimpleGraph", "Examples\UAP.SimpleGraph\UAP.SimpleGraph.csproj", "{51C7122B-AAD1-4C49-B2E9-1B09B367952F}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
@ -125,43 +123,6 @@ Global
|
|||
{C2718C9A-6455-43F6-835A-26B788824F53}.Release|ARM.ActiveCfg = Release|Any CPU
|
||||
{C2718C9A-6455-43F6-835A-26B788824F53}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{C2718C9A-6455-43F6-835A-26B788824F53}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{66F33708-C1C7-4385-8235-7201784D184C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{66F33708-C1C7-4385-8235-7201784D184C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{66F33708-C1C7-4385-8235-7201784D184C}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{66F33708-C1C7-4385-8235-7201784D184C}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{66F33708-C1C7-4385-8235-7201784D184C}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{66F33708-C1C7-4385-8235-7201784D184C}.Debug|x64.Build.0 = Debug|x64
|
||||
{66F33708-C1C7-4385-8235-7201784D184C}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{66F33708-C1C7-4385-8235-7201784D184C}.Debug|x86.Build.0 = Debug|x86
|
||||
{66F33708-C1C7-4385-8235-7201784D184C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{66F33708-C1C7-4385-8235-7201784D184C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{66F33708-C1C7-4385-8235-7201784D184C}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{66F33708-C1C7-4385-8235-7201784D184C}.Release|ARM.Build.0 = Release|ARM
|
||||
{66F33708-C1C7-4385-8235-7201784D184C}.Release|x64.ActiveCfg = Release|x64
|
||||
{66F33708-C1C7-4385-8235-7201784D184C}.Release|x64.Build.0 = Release|x64
|
||||
{66F33708-C1C7-4385-8235-7201784D184C}.Release|x86.ActiveCfg = Release|x86
|
||||
{66F33708-C1C7-4385-8235-7201784D184C}.Release|x86.Build.0 = Release|x86
|
||||
{44841666-C547-4874-9BC9-B34D2A1FA6D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{44841666-C547-4874-9BC9-B34D2A1FA6D8}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
|
||||
{44841666-C547-4874-9BC9-B34D2A1FA6D8}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{44841666-C547-4874-9BC9-B34D2A1FA6D8}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{44841666-C547-4874-9BC9-B34D2A1FA6D8}.Debug|ARM.Deploy.0 = Debug|ARM
|
||||
{44841666-C547-4874-9BC9-B34D2A1FA6D8}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{44841666-C547-4874-9BC9-B34D2A1FA6D8}.Debug|x64.Build.0 = Debug|x64
|
||||
{44841666-C547-4874-9BC9-B34D2A1FA6D8}.Debug|x64.Deploy.0 = Debug|x64
|
||||
{44841666-C547-4874-9BC9-B34D2A1FA6D8}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{44841666-C547-4874-9BC9-B34D2A1FA6D8}.Debug|x86.Build.0 = Debug|x86
|
||||
{44841666-C547-4874-9BC9-B34D2A1FA6D8}.Debug|x86.Deploy.0 = Debug|x86
|
||||
{44841666-C547-4874-9BC9-B34D2A1FA6D8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{44841666-C547-4874-9BC9-B34D2A1FA6D8}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{44841666-C547-4874-9BC9-B34D2A1FA6D8}.Release|ARM.Build.0 = Release|ARM
|
||||
{44841666-C547-4874-9BC9-B34D2A1FA6D8}.Release|ARM.Deploy.0 = Release|ARM
|
||||
{44841666-C547-4874-9BC9-B34D2A1FA6D8}.Release|x64.ActiveCfg = Release|x64
|
||||
{44841666-C547-4874-9BC9-B34D2A1FA6D8}.Release|x64.Build.0 = Release|x64
|
||||
{44841666-C547-4874-9BC9-B34D2A1FA6D8}.Release|x64.Deploy.0 = Release|x64
|
||||
{44841666-C547-4874-9BC9-B34D2A1FA6D8}.Release|x86.ActiveCfg = Release|x86
|
||||
{44841666-C547-4874-9BC9-B34D2A1FA6D8}.Release|x86.Build.0 = Release|x86
|
||||
{44841666-C547-4874-9BC9-B34D2A1FA6D8}.Release|x86.Deploy.0 = Release|x86
|
||||
{C054C423-7284-46A6-9738-B82E2237E9C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C054C423-7284-46A6-9738-B82E2237E9C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C054C423-7284-46A6-9738-B82E2237E9C7}.Debug|ARM.ActiveCfg = Debug|Any CPU
|
||||
|
@ -178,8 +139,24 @@ Global
|
|||
{C054C423-7284-46A6-9738-B82E2237E9C7}.Release|x64.Build.0 = Release|Any CPU
|
||||
{C054C423-7284-46A6-9738-B82E2237E9C7}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{C054C423-7284-46A6-9738-B82E2237E9C7}.Release|x86.Build.0 = Release|Any CPU
|
||||
{4BEBC41E-2710-4613-80B1-198E08D10619}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{4BEBC41E-2710-4613-80B1-198E08D10619}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4BEBC41E-2710-4613-80B1-198E08D10619}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{4BEBC41E-2710-4613-80B1-198E08D10619}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{4BEBC41E-2710-4613-80B1-198E08D10619}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{4BEBC41E-2710-4613-80B1-198E08D10619}.Debug|x64.Build.0 = Debug|x64
|
||||
{4BEBC41E-2710-4613-80B1-198E08D10619}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{4BEBC41E-2710-4613-80B1-198E08D10619}.Debug|x86.Build.0 = Debug|x86
|
||||
{4BEBC41E-2710-4613-80B1-198E08D10619}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4BEBC41E-2710-4613-80B1-198E08D10619}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{4BEBC41E-2710-4613-80B1-198E08D10619}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{4BEBC41E-2710-4613-80B1-198E08D10619}.Release|ARM.Build.0 = Release|ARM
|
||||
{4BEBC41E-2710-4613-80B1-198E08D10619}.Release|x64.ActiveCfg = Release|x64
|
||||
{4BEBC41E-2710-4613-80B1-198E08D10619}.Release|x64.Build.0 = Release|x64
|
||||
{4BEBC41E-2710-4613-80B1-198E08D10619}.Release|x86.ActiveCfg = Release|x86
|
||||
{4BEBC41E-2710-4613-80B1-198E08D10619}.Release|x86.Build.0 = Release|x86
|
||||
{51C7122B-AAD1-4C49-B2E9-1B09B367952F}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{51C7122B-AAD1-4C49-B2E9-1B09B367952F}.Debug|Any CPU.Deploy.0 = Debug|x86
|
||||
{51C7122B-AAD1-4C49-B2E9-1B09B367952F}.Debug|Any CPU.Build.0 = Debug|x86
|
||||
{51C7122B-AAD1-4C49-B2E9-1B09B367952F}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{51C7122B-AAD1-4C49-B2E9-1B09B367952F}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{51C7122B-AAD1-4C49-B2E9-1B09B367952F}.Debug|ARM.Deploy.0 = Debug|ARM
|
||||
|
@ -208,11 +185,11 @@ Global
|
|||
{E00C5274-AA34-4CC1-BB24-F59BCF130B85} = {D9664367-2C2C-46B2-81A6-26CDCD087B29}
|
||||
{E8B92A96-39FD-441D-9925-34A6F6DC8BEE} = {D9664367-2C2C-46B2-81A6-26CDCD087B29}
|
||||
{C2718C9A-6455-43F6-835A-26B788824F53} = {D9664367-2C2C-46B2-81A6-26CDCD087B29}
|
||||
{44841666-C547-4874-9BC9-B34D2A1FA6D8} = {D9664367-2C2C-46B2-81A6-26CDCD087B29}
|
||||
{C054C423-7284-46A6-9738-B82E2237E9C7} = {D9664367-2C2C-46B2-81A6-26CDCD087B29}
|
||||
{51C7122B-AAD1-4C49-B2E9-1B09B367952F} = {D9664367-2C2C-46B2-81A6-26CDCD087B29}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
VisualSVNWorkingCopyRoot = .
|
||||
SolutionGuid = {9548CBF3-9C1D-4132-B928-475E2AA6A99B}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -1,46 +1,52 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
#if WPF
|
||||
|
||||
using System.Windows;
|
||||
|
||||
#elif METRO
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Input;
|
||||
using Windows.Foundation;
|
||||
using System.Linq;
|
||||
#endif
|
||||
|
||||
using GraphX.PCL.Common.Exceptions;
|
||||
using GraphX.PCL.Common.Interfaces;
|
||||
using GraphX.PCL.Common.Models;
|
||||
|
||||
namespace GraphX.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// Dragging behavior of objects in a GraphX graph area is influenced using the attached properties of this class.
|
||||
///
|
||||
///
|
||||
/// To enable dragging of an individual object, set the IsDragEnabled attached property to true on that object. When IsDragEnabled is true, the
|
||||
/// object can be used to initiate dragging.
|
||||
///
|
||||
///
|
||||
/// To drag a group of vertices, set the IsTagged attached property to true for all of the vertices in the group. When dragging is started from
|
||||
/// one of the tagged vertices, all of the tagged ones will be move.
|
||||
///
|
||||
///
|
||||
/// "Primary drag object" defined: Whichever object gets the mouse/pointer events is treated as the primary drag object and its attached properties take
|
||||
/// precedence for controlling drag behavior. When only one object is being dragged, it is the primary drag object. When a group of objects is tagged
|
||||
/// and being dragged together, the one getting mouse events is the primary drag object.
|
||||
///
|
||||
///
|
||||
/// There is limited support for dragging edges. It is achieved by setting IsDragEnabled to true for the edge AND tagging the edge and the vertices
|
||||
/// it is attached to. When the user drags the edge, the drag is actually performed on the vertices.
|
||||
///
|
||||
///
|
||||
/// For edges to be updated as a vertex is moved, set UpdateEdgesOnMove to true for the object being dragged.
|
||||
///
|
||||
///
|
||||
/// Snapping is turned on or off by the GlobalIsSnappingPredicate or by the IsSnappingPredicate property on the primary drag object. The predicate is
|
||||
/// called with each movement of the mouse/pointer and the primary drag object is passed in. If snapping should be performed, the predicate must return
|
||||
/// true. To skip snapping logic, the predicate must return false. If no predicate is set using the IsSnappingPredicate, the GlobalIsSnappingPredicate
|
||||
/// is used. The default behavior is to snap while a shift key alone is pressed.
|
||||
///
|
||||
///
|
||||
/// When dragging a group of objects and using snapping, there is an additional refinement that can be used for the snapping behavior of the individual
|
||||
/// objects in the group. The individual objects can move the exact same amount as the primary object when it snaps, or they can snap individually, with
|
||||
/// the snap calculation being performed for each one. The behavior is controlled for the entire group by the GlobalIsSnappingIndividuallyPredicate or
|
||||
/// the IsIndividualSnappingPredicate property setting ON THE PRIMARY DRAG OBJECT. The default behavior is to move all dragged objects by the same offset
|
||||
/// as the primary drag object.
|
||||
///
|
||||
///
|
||||
/// Snapping calculations are performed by the functions set on the primary drag object using the GlobalXSnapModifier or XSnapModifier property and the
|
||||
/// GlobalYSnapModifier or YSnapModifier propery. These functions are called for each movement and provided the GraphAreaBase, object being moved, and
|
||||
/// the pre-snapped x or y value. The passed in parameters are intended to provide an opportunity to find elements within the graph area and do things
|
||||
|
@ -65,7 +71,7 @@ namespace GraphX.Controls
|
|||
|
||||
private static readonly SnapModifierFunc _builtinSnapModifier = (area, obj, val) => Math.Round(val * 0.1) * 10.0;
|
||||
|
||||
#endregion
|
||||
#endregion Built-in snapping behavior
|
||||
|
||||
#region Global snapping behavior management
|
||||
|
||||
|
@ -94,7 +100,6 @@ namespace GraphX.Controls
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private static Predicate<DependencyObject> _globalIsIndividualSnappingPredicate = _builtinIsIndividualSnappingPredicate;
|
||||
|
||||
/// <summary>
|
||||
|
@ -171,19 +176,22 @@ namespace GraphX.Controls
|
|||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion Global snapping behavior management
|
||||
|
||||
#region Attached DPs
|
||||
|
||||
public static readonly DependencyProperty IsDragEnabledProperty = DependencyProperty.RegisterAttached("IsDragEnabled", typeof(bool), typeof(DragBehaviour), new PropertyMetadata(false, OnIsDragEnabledPropertyChanged));
|
||||
public static readonly DependencyProperty UpdateEdgesOnMoveProperty = DependencyProperty.RegisterAttached("UpdateEdgesOnMove", typeof(bool), typeof(DragBehaviour), new PropertyMetadata(false));
|
||||
public static readonly DependencyProperty IsTaggedProperty = DependencyProperty.RegisterAttached("IsTagged", typeof(bool), typeof(DragBehaviour), new PropertyMetadata(false));
|
||||
public static readonly DependencyProperty IsDraggingProperty = DependencyProperty.RegisterAttached("IsDragging", typeof(bool), typeof(DragBehaviour), new PropertyMetadata(false));
|
||||
public static readonly DependencyProperty IsSnappingPredicateProperty = DependencyProperty.RegisterAttached("IsSnappingPredicate", typeof(Predicate<DependencyObject>), typeof(DragBehaviour), new PropertyMetadata(new Predicate<DependencyObject>(obj => { return _globalIsSnappingPredicate(obj); })));
|
||||
public static readonly DependencyProperty IsIndividualSnappingPredicateProperty = DependencyProperty.RegisterAttached("IsIndividualSnappingPredicate", typeof(Predicate<DependencyObject>), typeof(DragBehaviour), new PropertyMetadata(new Predicate<DependencyObject>(obj => { return _globalIsIndividualSnappingPredicate(obj); })));
|
||||
|
||||
/// <summary>
|
||||
/// Snap feature modifier delegate for X axis
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty XSnapModifierProperty = DependencyProperty.RegisterAttached("XSnapModifier", typeof(SnapModifierFunc), typeof(DragBehaviour), new PropertyMetadata(new SnapModifierFunc((area, obj, val) => _globalXSnapModifier(area, obj, val))));
|
||||
|
||||
/// <summary>
|
||||
/// Snap feature modifier delegate for Y axis
|
||||
/// </summary>
|
||||
|
@ -193,9 +201,11 @@ namespace GraphX.Controls
|
|||
private static readonly DependencyProperty OriginalYProperty = DependencyProperty.RegisterAttached("OriginalY", typeof(double), typeof(DragBehaviour), new PropertyMetadata(0.0));
|
||||
private static readonly DependencyProperty OriginalMouseXProperty = DependencyProperty.RegisterAttached("OriginalMouseX", typeof(double), typeof(DragBehaviour), new PropertyMetadata(0.0));
|
||||
private static readonly DependencyProperty OriginalMouseYProperty = DependencyProperty.RegisterAttached("OriginalMouseY", typeof(double), typeof(DragBehaviour), new PropertyMetadata(0.0));
|
||||
#endregion
|
||||
|
||||
#endregion Attached DPs
|
||||
|
||||
#region Get/Set method for Attached Properties
|
||||
|
||||
public static bool GetUpdateEdgesOnMove(DependencyObject obj)
|
||||
{
|
||||
return (bool)obj.GetValue(UpdateEdgesOnMoveProperty);
|
||||
|
@ -276,7 +286,7 @@ namespace GraphX.Controls
|
|||
obj.SetValue(YSnapModifierProperty, value);
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion Get/Set method for Attached Properties
|
||||
|
||||
#region Get/Set methods for private Attached Properties
|
||||
|
||||
|
@ -319,9 +329,11 @@ namespace GraphX.Controls
|
|||
{
|
||||
obj.SetValue(OriginalMouseYProperty, value);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion Get/Set methods for private Attached Properties
|
||||
|
||||
#region PropertyChanged callbacks
|
||||
|
||||
private static void OnIsDragEnabledPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
#if WPF
|
||||
|
@ -341,8 +353,16 @@ namespace GraphX.Controls
|
|||
{
|
||||
//register the event handlers
|
||||
#if WPF
|
||||
element.MouseLeftButtonDown += OnDragStarted;
|
||||
element.PreviewMouseLeftButtonUp += OnDragFinished;
|
||||
if (element is VertexControl)
|
||||
{
|
||||
element.MouseLeftButtonDown += OnVertexDragStarted;
|
||||
element.PreviewMouseLeftButtonUp += OnVertexDragFinished;
|
||||
}
|
||||
else if (element is EdgeControl)
|
||||
{
|
||||
element.MouseLeftButtonDown += OnEdgeDrageStarted;
|
||||
element.PreviewMouseLeftButtonUp += OnEdgeDragFinished;
|
||||
}
|
||||
#elif METRO
|
||||
element.PointerPressed += OnDragStarted;
|
||||
element.PointerReleased += OnDragFinished;
|
||||
|
@ -352,18 +372,107 @@ namespace GraphX.Controls
|
|||
{
|
||||
//unregister the event handlers
|
||||
#if WPF
|
||||
element.MouseLeftButtonDown -= OnDragStarted;
|
||||
element.PreviewMouseLeftButtonUp -= OnDragFinished;
|
||||
if (element is VertexControl)
|
||||
{
|
||||
element.MouseLeftButtonDown -= OnVertexDragStarted;
|
||||
element.PreviewMouseLeftButtonUp -= OnVertexDragFinished;
|
||||
}
|
||||
else if (element is EdgeControl)
|
||||
{
|
||||
element.MouseLeftButtonDown -= OnEdgeDrageStarted;
|
||||
element.PreviewMouseLeftButtonUp -= OnEdgeDragFinished;
|
||||
}
|
||||
#elif METRO
|
||||
element.PointerPressed -= OnDragStarted;
|
||||
element.PointerReleased -= OnDragFinished;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion PropertyChanged callbacks
|
||||
#if WPF
|
||||
private static void OnDragStarted(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
||||
private static void OnEdgeDrageStarted(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
||||
{
|
||||
DependencyObject obj = sender as DependencyObject;
|
||||
|
||||
SetIsDragging(obj, true);
|
||||
|
||||
var element = obj as IInputElement;
|
||||
if (element != null)
|
||||
{
|
||||
element.CaptureMouse();
|
||||
element.MouseMove -= OnEdgeDragging;
|
||||
element.MouseMove += OnEdgeDragging;
|
||||
}
|
||||
else throw new GX_InvalidDataException("The control must be a descendent of the FrameworkElement or FrameworkContentElement!");
|
||||
|
||||
e.Handled = false;
|
||||
}
|
||||
|
||||
private static void OnEdgeDragging(object sender, System.Windows.Input.MouseEventArgs e)
|
||||
{
|
||||
var obj = sender as DependencyObject;
|
||||
if (!GetIsDragging(obj))
|
||||
return;
|
||||
|
||||
EdgeControl edgeControl = sender as EdgeControl;
|
||||
|
||||
edgeControl.PrepareEdgePathFromMousePointer();
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private static void OnEdgeDragFinished(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
||||
{
|
||||
EdgeControl edgeControl = sender as EdgeControl;
|
||||
|
||||
if (edgeControl == null) return;
|
||||
|
||||
GraphAreaBase graphAreaBase = edgeControl.RootArea;
|
||||
|
||||
VertexControl vertexControl = graphAreaBase.GetVertexControlAt(e.GetPosition(graphAreaBase));
|
||||
|
||||
if (vertexControl != null)
|
||||
{
|
||||
edgeControl.Target = vertexControl;
|
||||
|
||||
if (vertexControl.VertexConnectionPointsList.Count > 0)
|
||||
{
|
||||
IVertexConnectionPoint vertexConnectionPoint = vertexControl.GetConnectionPointAt(e.GetPosition(graphAreaBase));
|
||||
|
||||
var edge = edgeControl.Edge as IGraphXCommonEdge;
|
||||
|
||||
if (vertexConnectionPoint != null)
|
||||
{
|
||||
edge.TargetConnectionPointId = vertexConnectionPoint.Id;
|
||||
}
|
||||
else
|
||||
{
|
||||
edge.TargetConnectionPointId = null;
|
||||
}
|
||||
}
|
||||
|
||||
edgeControl.UpdateEdge();
|
||||
|
||||
var obj = (DependencyObject)sender;
|
||||
SetIsDragging(obj, false);
|
||||
//obj.ClearValue(OriginalMouseXProperty);
|
||||
//obj.ClearValue(OriginalMouseYProperty);
|
||||
//obj.ClearValue(OriginalXProperty);
|
||||
//obj.ClearValue(OriginalYProperty);
|
||||
|
||||
var element = sender as IInputElement;
|
||||
if (element != null)
|
||||
{
|
||||
element.MouseMove -= OnVertexDragging;
|
||||
element.ReleaseMouseCapture();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if WPF
|
||||
|
||||
private static void OnVertexDragStarted(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
||||
#elif METRO
|
||||
private static void OnDragStarted( object sender, PointerRoutedEventArgs e )
|
||||
#endif
|
||||
|
@ -382,16 +491,13 @@ namespace GraphX.Controls
|
|||
SetOriginalX(obj, GraphAreaBase.GetFinalX(obj));
|
||||
SetOriginalY(obj, GraphAreaBase.GetFinalY(obj));
|
||||
|
||||
// Save starting position of all tagged elements
|
||||
if (GetIsTagged(obj))
|
||||
{
|
||||
foreach (var item in area.GetAllVertexControls())
|
||||
if (GetIsTagged(item))
|
||||
{
|
||||
SetOriginalX(item, GraphAreaBase.GetFinalX(item));
|
||||
SetOriginalY(item, GraphAreaBase.GetFinalY(item));
|
||||
}
|
||||
}
|
||||
// Save starting position of all other tagged elements
|
||||
foreach (var item in area.GetAllVertexControls())
|
||||
if (!ReferenceEquals(item, obj) && GetIsTagged(item))
|
||||
{
|
||||
SetOriginalX(item, GraphAreaBase.GetFinalX(item));
|
||||
SetOriginalY(item, GraphAreaBase.GetFinalY(item));
|
||||
}
|
||||
|
||||
//capture the mouse
|
||||
#if WPF
|
||||
|
@ -399,8 +505,8 @@ namespace GraphX.Controls
|
|||
if (element != null)
|
||||
{
|
||||
element.CaptureMouse();
|
||||
element.MouseMove -= OnDragging;
|
||||
element.MouseMove += OnDragging;
|
||||
element.MouseMove -= OnVertexDragging;
|
||||
element.MouseMove += OnVertexDragging;
|
||||
}
|
||||
//else throw new GX_InvalidDataException("The control must be a descendent of the FrameworkElement or FrameworkContentElement!");
|
||||
e.Handled = false;
|
||||
|
@ -416,7 +522,8 @@ namespace GraphX.Controls
|
|||
}
|
||||
|
||||
#if WPF
|
||||
private static void OnDragFinished(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
||||
|
||||
private static void OnVertexDragFinished(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
||||
#elif METRO
|
||||
private static void OnDragFinished( object sender, PointerRoutedEventArgs e )
|
||||
#endif
|
||||
|
@ -445,7 +552,7 @@ namespace GraphX.Controls
|
|||
var element = sender as IInputElement;
|
||||
if (element != null)
|
||||
{
|
||||
element.MouseMove -= OnDragging;
|
||||
element.MouseMove -= OnVertexDragging;
|
||||
element.ReleaseMouseCapture();
|
||||
}
|
||||
#elif METRO
|
||||
|
@ -459,7 +566,8 @@ namespace GraphX.Controls
|
|||
}
|
||||
|
||||
#if WPF
|
||||
private static void OnDragging(object sender, System.Windows.Input.MouseEventArgs e)
|
||||
|
||||
private static void OnVertexDragging(object sender, System.Windows.Input.MouseEventArgs e)
|
||||
#elif METRO
|
||||
private static void OnDragging( object sender, PointerRoutedEventArgs e )
|
||||
#endif
|
||||
|
@ -578,6 +686,7 @@ namespace GraphX.Controls
|
|||
}
|
||||
|
||||
#if WPF
|
||||
|
||||
private static Point GetPositionInArea(GraphAreaBase area, System.Windows.Input.MouseEventArgs e)
|
||||
#elif METRO
|
||||
private static Windows.Foundation.Point GetPositionInArea(GraphAreaBase area, PointerRoutedEventArgs e)
|
||||
|
@ -609,4 +718,4 @@ namespace GraphX.Controls
|
|||
return area;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -12,6 +12,7 @@ using Windows.UI.Xaml.Controls;
|
|||
using Windows.UI.Xaml.Input;
|
||||
#endif
|
||||
using GraphX.Controls.Models;
|
||||
using GraphX.PCL.Common;
|
||||
using GraphX.PCL.Common.Enums;
|
||||
using GraphX.PCL.Common.Interfaces;
|
||||
|
||||
|
@ -57,26 +58,6 @@ namespace GraphX.Controls
|
|||
|
||||
#endregion
|
||||
|
||||
public event EdgeLabelEventHandler LabelMouseDown;
|
||||
protected void OnLabelMouseDown(MouseButtonEventArgs mArgs, ModifierKeys keys)
|
||||
{
|
||||
LabelMouseDown?.Invoke(this, new EdgeLabelSelectedEventArgs(EdgeLabelControl, this, mArgs, keys));
|
||||
}
|
||||
|
||||
protected override void OnEdgeLabelUpdated()
|
||||
{
|
||||
var ctrl = EdgeLabelControl as Control;
|
||||
if (ctrl == null) return;
|
||||
#if WPF
|
||||
MouseButtonEventHandler func = (sender, args) => OnLabelMouseDown(args, Keyboard.Modifiers);
|
||||
ctrl.MouseDown -= func;
|
||||
ctrl.MouseDown += func;
|
||||
#elif METRO
|
||||
PointerEventHandler func = (sender, args) => OnLabelMouseDown(args, null);
|
||||
ctrl.PointerPressed -= func;
|
||||
ctrl.PointerPressed += func;
|
||||
#endif
|
||||
}
|
||||
|
||||
#region public Clean()
|
||||
public override void Clean()
|
||||
|
@ -90,11 +71,8 @@ namespace GraphX.Controls
|
|||
Linegeometry = null;
|
||||
LinePathObject = null;
|
||||
SelfLoopIndicator = null;
|
||||
if (EdgeLabelControl != null)
|
||||
{
|
||||
EdgeLabelControl.Dispose();
|
||||
EdgeLabelControl = null;
|
||||
}
|
||||
EdgeLabelControls.ForEach(l=> l.Dispose());
|
||||
EdgeLabelControls.Clear();
|
||||
|
||||
if (EdgePointerForSource != null)
|
||||
{
|
||||
|
@ -136,13 +114,17 @@ namespace GraphX.Controls
|
|||
{
|
||||
_oldSource.PositionChanged -= source_PositionChanged;
|
||||
_oldSource.SizeChanged -= Source_SizeChanged;
|
||||
#if WPF
|
||||
_oldSource.EventOptions.PositionChangeNotification = _sourceTrace;
|
||||
#endif
|
||||
}
|
||||
_oldSource = Source;
|
||||
if (Source != null)
|
||||
{
|
||||
#if WPF
|
||||
_sourceTrace = Source.EventOptions.PositionChangeNotification;
|
||||
Source.EventOptions.PositionChangeNotification = true;
|
||||
#endif
|
||||
Source.PositionChanged += source_PositionChanged;
|
||||
Source.SizeChanged += Source_SizeChanged;
|
||||
}
|
||||
|
@ -159,13 +141,17 @@ namespace GraphX.Controls
|
|||
{
|
||||
_oldTarget.PositionChanged -= source_PositionChanged;
|
||||
_oldTarget.SizeChanged -= Source_SizeChanged;
|
||||
#if WPF
|
||||
_oldTarget.EventOptions.PositionChangeNotification = _targetTrace;
|
||||
#endif
|
||||
}
|
||||
_oldTarget = Target;
|
||||
if (Target != null)
|
||||
{
|
||||
#if WPF
|
||||
_targetTrace = Target.EventOptions.PositionChangeNotification;
|
||||
Target.EventOptions.PositionChangeNotification = true;
|
||||
#endif
|
||||
Target.PositionChanged += source_PositionChanged;
|
||||
Target.SizeChanged += Source_SizeChanged;
|
||||
}
|
||||
|
@ -267,13 +253,12 @@ namespace GraphX.Controls
|
|||
{
|
||||
}
|
||||
|
||||
public EdgeControl(VertexControl source, VertexControl target, object edge, bool showLabels = false, bool showArrows = true)
|
||||
public EdgeControl(VertexControl source, VertexControl target, object edge, bool showArrows = true)
|
||||
{
|
||||
DataContext = edge;
|
||||
Source = source; Target = target;
|
||||
Edge = edge; DataContext = edge;
|
||||
this.SetCurrentValue(ShowArrowsProperty, showArrows);
|
||||
this.SetCurrentValue(ShowLabelProperty, showLabels);
|
||||
IsHiddenEdgesUpdated = true;
|
||||
|
||||
#if METRO
|
||||
|
|
|
@ -57,6 +57,7 @@ namespace GraphX.Controls
|
|||
AttachNode.IsVisibleChanged += AttachNode_IsVisibleChanged;
|
||||
#elif METRO
|
||||
AttachNode = node;
|
||||
|
||||
#endif
|
||||
node.AttachLabel(this);
|
||||
}
|
||||
|
@ -76,7 +77,7 @@ namespace GraphX.Controls
|
|||
#if WPF
|
||||
void AttachNode_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if(AttachNode.IsVisible && AttachNode.ShowLabel)
|
||||
if(AttachNode.IsVisible && ShowLabel)
|
||||
base.Show();
|
||||
else if (!AttachNode.IsVisible)
|
||||
{
|
||||
|
|
|
@ -31,8 +31,59 @@ namespace GraphX.Controls
|
|||
//hack to fix weird METRO error when it can't find this class
|
||||
[Bindable]
|
||||
#endif
|
||||
public class EdgeLabelControl : ContentControl, IEdgeLabelControl
|
||||
public abstract class EdgeLabelControl : ContentControl, IEdgeLabelControl
|
||||
{
|
||||
|
||||
public static readonly DependencyProperty AlignToEdgeProperty = DependencyProperty.Register("AlignToEdge",
|
||||
typeof(bool),
|
||||
typeof(EdgeLabelControl),
|
||||
new PropertyMetadata(false, (o, e) =>
|
||||
{
|
||||
var ctrl = (EdgeLabelControl) o;
|
||||
if ((bool)e.NewValue == false) ctrl.Angle = 0;
|
||||
ctrl.UpdatePosition();
|
||||
} ));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets if lables should be aligned to edges and be displayed under the same angle
|
||||
/// </summary>
|
||||
public bool AlignToEdge { get { return (bool)GetValue(AlignToEdgeProperty); } set { SetValue(AlignToEdgeProperty, value); }}
|
||||
|
||||
|
||||
public static readonly DependencyProperty LabelVerticalOffsetProperty = DependencyProperty.Register("LabelVerticalOffset",
|
||||
typeof(double),
|
||||
typeof(EdgeLabelControl),
|
||||
new PropertyMetadata(0d));
|
||||
|
||||
/// <summary>
|
||||
/// Offset for label Y axis to display it above/below the edge
|
||||
/// </summary>
|
||||
public double LabelVerticalOffset { get { return (double)GetValue(LabelVerticalOffsetProperty); } set { SetValue(LabelVerticalOffsetProperty, value); } }
|
||||
|
||||
public static readonly DependencyProperty LabelHorizontalOffsetProperty = DependencyProperty.Register("LabelHorizontalOffset",
|
||||
typeof(double),
|
||||
typeof(EdgeLabelControl),
|
||||
new PropertyMetadata(0d));
|
||||
|
||||
/// <summary>
|
||||
/// Offset for label X axis to display it along the edge
|
||||
/// </summary>
|
||||
public double LabelHorizontalOffset { get { return (double)GetValue(LabelHorizontalOffsetProperty); } set { SetValue(LabelHorizontalOffsetProperty, value); } }
|
||||
|
||||
public static readonly DependencyProperty ShowLabelProperty = DependencyProperty.Register("ShowLabel",
|
||||
typeof(bool),
|
||||
typeof(EdgeLabelControl),
|
||||
new PropertyMetadata(false, showlabel_changed));
|
||||
|
||||
private static void showlabel_changed(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
(d as EdgeLabelControl)?.EdgeControl.UpdateEdge();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Show edge label.Default value is False.
|
||||
/// </summary>
|
||||
public bool ShowLabel { get { return (bool)GetValue(ShowLabelProperty); } set { SetValue(ShowLabelProperty, value); } }
|
||||
|
||||
public static readonly DependencyProperty DisplayForSelfLoopedEdgesProperty = DependencyProperty.Register("DisplayForSelfLoopedEdges",
|
||||
typeof(bool),
|
||||
|
@ -228,12 +279,14 @@ namespace GraphX.Controls
|
|||
var desiredSize = DesiredSize;
|
||||
bool flipAxis = p1.X > p2.X; // Flip axis if source is "after" target
|
||||
|
||||
ApplyLabelHorizontalOffset(edgeLength, LabelHorizontalOffset);
|
||||
|
||||
// Calculate the center point of the edge
|
||||
var centerPoint = new Point(p1.X + edgeLength * Math.Cos(angleBetweenPoints), p1.Y - edgeLength * Math.Sin(angleBetweenPoints));
|
||||
if (EdgeControl.AlignLabelsToEdges)
|
||||
if (AlignToEdge)
|
||||
{
|
||||
// If we're aligning labels to the edges make sure add the label vertical offset
|
||||
var yEdgeOffset = EdgeControl.LabelVerticalOffset;
|
||||
var yEdgeOffset = LabelVerticalOffset;
|
||||
if (FlipOnRotation && flipAxis && !EdgeControl.IsParallel) // If we've flipped axis, move the offset to the other side of the edge
|
||||
yEdgeOffset = -yEdgeOffset;
|
||||
|
||||
|
@ -250,7 +303,19 @@ namespace GraphX.Controls
|
|||
|
||||
UpdateFinalPosition(centerPoint, desiredSize);
|
||||
|
||||
#if METRO
|
||||
GraphAreaBase.SetX(this, LastKnownRectSize.X, true);
|
||||
GraphAreaBase.SetY(this, LastKnownRectSize.Y, true);
|
||||
#else
|
||||
Arrange(LastKnownRectSize);
|
||||
#endif
|
||||
}
|
||||
|
||||
protected virtual double ApplyLabelHorizontalOffset(double edgeLength, double offset)
|
||||
{
|
||||
if (offset == 0) return edgeLength;
|
||||
edgeLength += edgeLength / 100 * offset;
|
||||
return edgeLength;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -314,7 +379,7 @@ namespace GraphX.Controls
|
|||
|
||||
void EdgeLabelControl_LayoutUpdated(object sender, DefaultEventArgs e)
|
||||
{
|
||||
if (EdgeControl == null || !EdgeControl.ShowLabel) return;
|
||||
if (EdgeControl == null || !ShowLabel) return;
|
||||
if (LastKnownRectSize == SysRect.Empty || double.IsNaN(LastKnownRectSize.Width) || LastKnownRectSize.Width == 0)
|
||||
{
|
||||
UpdateLayout();
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
#if WPF
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using DefaultEventArgs = System.EventArgs;
|
||||
#elif METRO
|
||||
using System;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Media;
|
||||
|
@ -32,9 +34,13 @@ namespace GraphX.Controls
|
|||
/// </summary>
|
||||
static DefaultEdgePointer()
|
||||
{
|
||||
#if WPF
|
||||
var oldPmd = VisibilityProperty.GetMetadata(typeof(DefaultEdgePointer).BaseType);
|
||||
var newPmd = new PropertyMetadata(oldPmd.DefaultValue, oldPmd.PropertyChangedCallback, CoerceVisibility);
|
||||
VisibilityProperty.OverrideMetadata(typeof(DefaultEdgePointer), newPmd);
|
||||
#else
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
#region Common part
|
||||
|
@ -58,15 +64,19 @@ namespace GraphX.Controls
|
|||
typeof(bool),
|
||||
typeof(EdgeControl),
|
||||
new PropertyMetadata(true));
|
||||
/// <summary>
|
||||
/// Gets or sets if image has to be rotated according to edge directions
|
||||
/// </summary>
|
||||
/// <inheritdoc />
|
||||
public bool NeedRotation
|
||||
{
|
||||
get { return (bool)GetValue(NeedRotationProperty); }
|
||||
set { SetValue(NeedRotationProperty, value); }
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Point GetPosition()
|
||||
{
|
||||
return LastKnownRectSize.IsEmpty ? new Point() : LastKnownRectSize.Center();
|
||||
}
|
||||
|
||||
public void Show()
|
||||
{
|
||||
#if WPF
|
||||
|
@ -101,10 +111,17 @@ namespace GraphX.Controls
|
|||
IsSuppressed = false;
|
||||
}
|
||||
|
||||
#if WPF
|
||||
private static readonly DependencyPropertyKey IsSuppressedPropertyKey =
|
||||
DependencyProperty.RegisterReadOnly("IsSuppressed", typeof(bool), typeof(DefaultEdgePointer), new PropertyMetadata(false, OnSuppressChanged));
|
||||
|
||||
public static readonly DependencyProperty IsSuppressedProperty = IsSuppressedPropertyKey.DependencyProperty;
|
||||
#else
|
||||
private static readonly DependencyProperty IsSuppressedPropertyKey =
|
||||
DependencyProperty.Register("IsSuppressed", typeof(bool), typeof(DefaultEdgePointer), new PropertyMetadata(false, OnSuppressChanged));
|
||||
|
||||
public static readonly DependencyProperty IsSuppressedProperty = IsSuppressedPropertyKey;
|
||||
#endif
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the pointer is suppressed. A suppressed pointer won't be displayed, but
|
||||
|
@ -121,8 +138,10 @@ namespace GraphX.Controls
|
|||
/// </summary>
|
||||
private static void OnSuppressChanged(object source, DependencyPropertyChangedEventArgs args)
|
||||
{
|
||||
#if WPF
|
||||
var dep = source as DefaultEdgePointer;
|
||||
dep?.CoerceValue(VisibilityProperty);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -177,8 +196,16 @@ namespace GraphX.Controls
|
|||
Arrange(LastKnownRectSize);
|
||||
}
|
||||
|
||||
if(NeedRotation)
|
||||
RenderTransform = new RotateTransform { Angle = angle, CenterX = 0, CenterY = 0 };
|
||||
try
|
||||
{
|
||||
if (NeedRotation)
|
||||
RenderTransform = new RotateTransform {Angle = double.IsNaN(angle) ? 0 : angle, CenterX = 0, CenterY = 0};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//TODO ex handling and reason
|
||||
}
|
||||
|
||||
return new Point(direction.X * ActualWidth, direction.Y * ActualHeight);
|
||||
}
|
||||
|
||||
|
|
|
@ -66,8 +66,8 @@ namespace GraphX.Controls
|
|||
DependencyProperty.Register(nameof(LogicCore), typeof(IGXLogicCore<TVertex, TEdge, TGraph>), typeof(GraphArea<TVertex, TEdge, TGraph>), new PropertyMetadata(null, logic_core_changed));
|
||||
|
||||
private static
|
||||
#if METRO
|
||||
async
|
||||
#if METRO
|
||||
async
|
||||
#endif
|
||||
void logic_core_changed(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
|
@ -164,12 +164,13 @@ namespace GraphX.Controls
|
|||
internal override double EdgeCurvingTolerance => LogicCore?.EdgeCurvingTolerance ?? 0;
|
||||
|
||||
/// <summary>
|
||||
/// Add custom control for
|
||||
/// Add custom control for
|
||||
/// </summary>
|
||||
/// <param name="control"></param>
|
||||
public virtual void AddCustomChildControl(UIElement control)
|
||||
{
|
||||
Children.Add(control);
|
||||
if(!Children.Contains(control))
|
||||
Children.Add(control);
|
||||
SetX(control, 0);
|
||||
SetY(control, 0);
|
||||
}
|
||||
|
@ -242,7 +243,7 @@ namespace GraphX.Controls
|
|||
{
|
||||
EnableVisualPropsRecovery = true;
|
||||
EnableVisualPropsApply = true;
|
||||
//EdgeLabelFactory = new DefaultLabelFactory<AttachableEdgeLabelControl, IEdgeLabelControl>();
|
||||
EdgeLabelFactory = new DefaultEdgelabelFactory();
|
||||
//VertexLabelFactory = new DefaultLabelFactory<AttachableVertexLabelControl, IVertexLabelControl>();
|
||||
|
||||
#region Designer Data
|
||||
|
@ -302,9 +303,10 @@ namespace GraphX.Controls
|
|||
/// Returns first vertex that is found under specified coordinates
|
||||
/// </summary>
|
||||
/// <param name="position">GraphArea coordinate space position</param>
|
||||
public virtual VertexControl GetVertexControlAt(Point position)
|
||||
public override VertexControl GetVertexControlAt(Point position)
|
||||
{
|
||||
Measure(new USize(double.PositiveInfinity, double.PositiveInfinity));
|
||||
|
||||
return VertexList.Values.FirstOrDefault(a =>
|
||||
{
|
||||
var pos = a.GetPosition();
|
||||
|
@ -414,7 +416,7 @@ namespace GraphX.Controls
|
|||
/// <param name="removeEdgeFromDataGraph">Remove edge from data graph if possible. Default value is False.</param>
|
||||
public void RemoveEdge(TEdge edgeData, bool removeEdgeFromDataGraph = false)
|
||||
{
|
||||
RemoveEdgeInternal(edgeData, true);
|
||||
RemoveEdgeInternal(edgeData, true, removeEdgeFromDataGraph);
|
||||
var hasStorage = LogicCore?.AlgorithmStorage != null && (edgeData.SkipProcessing != ProcessingOptionEnum.Exclude || removeEdgeFromDataGraph);
|
||||
if (hasStorage) LogicCore.AlgorithmStorage.RemoveSingleEdge(edgeData);
|
||||
}
|
||||
|
@ -433,11 +435,8 @@ namespace GraphX.Controls
|
|||
|
||||
private void RemoveEdgeInternal(EdgeControlBase ctrl, bool removeEdgeFromDataGraph = false)
|
||||
{
|
||||
if (ctrl.EdgeLabelControl != null)
|
||||
{
|
||||
Children.Remove((UIElement)ctrl.EdgeLabelControl);
|
||||
ctrl.DetachLabel();
|
||||
}
|
||||
ctrl.DetachLabels();
|
||||
|
||||
Children.Remove(ctrl);
|
||||
if (removeEdgeFromDataGraph && LogicCore?.Graph != null && LogicCore.Graph.ContainsEdge(ctrl.Edge as TEdge))
|
||||
LogicCore.Graph.RemoveEdge(ctrl.Edge as TEdge);
|
||||
|
@ -658,14 +657,18 @@ namespace GraphX.Controls
|
|||
|
||||
protected virtual void GenerateVertexLabel(VertexControl vertexControl)
|
||||
{
|
||||
var label = VertexLabelFactory.CreateLabel(vertexControl);
|
||||
if (!(label is IVertexLabelControl))
|
||||
var labels = VertexLabelFactory.CreateLabel(vertexControl);
|
||||
if (labels == null) return;
|
||||
if (labels.Any(l=> !(l is IVertexLabelControl)))
|
||||
throw new GX_InvalidDataException("Generated vertex label should implement IVertexLabelControl interface");
|
||||
if (_svVertexLabelShow == false || vertexControl.Visibility != Visibility.Visible)
|
||||
label.Visibility = Visibility.Collapsed;
|
||||
AddCustomChildControl(label);
|
||||
label.Measure(new USize(double.MaxValue, double.MaxValue));
|
||||
((IVertexLabelControl)label).UpdatePosition();
|
||||
labels.ForEach(l =>
|
||||
{
|
||||
if (_svVertexLabelShow == false || vertexControl.Visibility != Visibility.Visible)
|
||||
l.Visibility = Visibility.Collapsed;
|
||||
AddCustomChildControl(l);
|
||||
l.Measure(new USize(double.MaxValue, double.MaxValue));
|
||||
((IVertexLabelControl)l).UpdatePosition();
|
||||
});
|
||||
}
|
||||
|
||||
protected virtual void GenerateEdgeLabels()
|
||||
|
@ -680,14 +683,17 @@ namespace GraphX.Controls
|
|||
|
||||
protected virtual void GenerateEdgeLabel(EdgeControl edgeControl)
|
||||
{
|
||||
var label = EdgeLabelFactory.CreateLabel(edgeControl);
|
||||
if (!(label is IEdgeLabelControl))
|
||||
var labels = EdgeLabelFactory.CreateLabel(edgeControl);
|
||||
if (labels == null) return;
|
||||
if (labels.Any(a=> !(a is IEdgeLabelControl)))
|
||||
throw new GX_InvalidDataException("Generated edge label should implement IEdgeLabelControl interface");
|
||||
if (_svShowEdgeLabels == false || edgeControl.Visibility != Visibility.Visible)
|
||||
label.Visibility = Visibility.Collapsed;
|
||||
AddCustomChildControl(label);
|
||||
label.Measure(new USize(double.MaxValue, double.MaxValue));
|
||||
((IEdgeLabelControl)label).UpdatePosition();
|
||||
|
||||
labels.ForEach(l =>
|
||||
{
|
||||
AddCustomChildControl(l);
|
||||
l.Measure(new USize(double.MaxValue, double.MaxValue));
|
||||
((IEdgeLabelControl)l).UpdatePosition();
|
||||
});
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -698,7 +704,7 @@ namespace GraphX.Controls
|
|||
/// </summary>
|
||||
public Dictionary<TVertex, Size> GetVertexSizes()
|
||||
{
|
||||
//measure if needed and get all vertex sizes
|
||||
//measure if needed and get all vertex sizes
|
||||
Measure(new USize(double.PositiveInfinity, double.PositiveInfinity));
|
||||
var vertexSizes = new Dictionary<TVertex, Size>(_vertexlist.Count(a => ((IGraphXVertex)a.Value.Vertex).SkipProcessing != ProcessingOptionEnum.Exclude));
|
||||
//go through the vertex presenters and get the actual layoutpositions
|
||||
|
@ -814,7 +820,7 @@ namespace GraphX.Controls
|
|||
private CancellationTokenSource _layoutCancellationSource;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets if visual graph should be updated if graph is filtered.
|
||||
/// Gets or sets if visual graph should be updated if graph is filtered.
|
||||
/// Remove all visuals with no keys in data graph and add all visuals that has keys in data graph.
|
||||
/// Default value is True.
|
||||
/// </summary>
|
||||
|
@ -896,7 +902,7 @@ namespace GraphX.Controls
|
|||
if (!localLogicCore.GenerateAlgorithmStorage(vertexSizes, vertexPositions))
|
||||
return;
|
||||
|
||||
//clear routing info
|
||||
//clear routing info
|
||||
localLogicCore.Graph.Edges.ForEach(a => a.RoutingPoints = null);
|
||||
|
||||
var resultCoords = localLogicCore.Compute(cancellationToken);
|
||||
|
@ -971,7 +977,7 @@ namespace GraphX.Controls
|
|||
/// </summary>
|
||||
/// <param name="generateAllEdges">Generate all available edges for graph</param>
|
||||
#if WPF
|
||||
public virtual void RelayoutGraph(bool generateAllEdges = false)
|
||||
public override void RelayoutGraph(bool generateAllEdges = false)
|
||||
{
|
||||
LogicCore.PushFilters();
|
||||
_relayoutGraphMain(generateAllEdges);
|
||||
|
@ -1025,7 +1031,7 @@ namespace GraphX.Controls
|
|||
}
|
||||
|
||||
#elif METRO
|
||||
public Task RelayoutGraphAsync(bool generateAllEdges = false)
|
||||
public override Task RelayoutGraphAsync(bool generateAllEdges = false)
|
||||
{
|
||||
return RelayoutGraphAsync(CancellationToken.None, generateAllEdges);
|
||||
}
|
||||
|
@ -1192,7 +1198,7 @@ namespace GraphX.Controls
|
|||
if (LogicCore.Graph == null)
|
||||
throw new InvalidDataException("GraphArea.GenerateGraph() -> LogicCore.Graph property is null while trying to generate graph!");
|
||||
|
||||
LogicCore.PushFilters();
|
||||
LogicCore.PushFilters();
|
||||
if (AutoAssignMissingDataId)
|
||||
AutoresolveIds(false, graph);
|
||||
if (!LogicCore.IsCustomLayout)
|
||||
|
@ -1326,10 +1332,11 @@ namespace GraphX.Controls
|
|||
|
||||
protected void ReapplySingleEdgeVisualProperties(EdgeControl item)
|
||||
{
|
||||
if (this._edgesDragEnabled != null) DragBehaviour.SetIsDragEnabled(item, this._edgesDragEnabled.Value);
|
||||
if (_svEdgeDashStyle != null) item.DashStyle = _svEdgeDashStyle.Value;
|
||||
if (_svShowEdgeArrows != null) item.SetCurrentValue(EdgeControlBase.ShowArrowsProperty, _svShowEdgeArrows.Value);
|
||||
if (_svShowEdgeLabels != null) item.ShowLabel = _svShowEdgeLabels.Value;
|
||||
if (_svAlignEdgeLabels != null) item.AlignLabelsToEdges = _svAlignEdgeLabels.Value;
|
||||
//if (_svShowEdgeLabels != null) item.ShowLabel = _svShowEdgeLabels.Value;
|
||||
//if (_svAlignEdgeLabels != null) item.AlignLabelsToEdges = _svAlignEdgeLabels.Value;
|
||||
if (_svUpdateLabelPosition != null) item.UpdateLabelPosition = _svUpdateLabelPosition.Value;
|
||||
if (_svEdgeHlEnabled != null) HighlightBehaviour.SetIsHighlightEnabled(item, _svEdgeHlEnabled.Value);
|
||||
if (_svEdgeHlObjectType != null) HighlightBehaviour.SetHighlightControl(item, _svEdgeHlObjectType.Value);
|
||||
|
@ -1369,16 +1376,16 @@ namespace GraphX.Controls
|
|||
item.SetCurrentValue(EdgeControlBase.ShowArrowsProperty, isEnabled);
|
||||
}
|
||||
|
||||
private bool? _svShowEdgeLabels;
|
||||
//private bool? _svShowEdgeLabels;
|
||||
/// <summary>
|
||||
/// Show or hide all edges labels
|
||||
/// </summary>
|
||||
/// <param name="isEnabled">Boolean value</param>
|
||||
public void ShowAllEdgesLabels(bool isEnabled = true)
|
||||
{
|
||||
_svShowEdgeLabels = isEnabled;
|
||||
//_svShowEdgeLabels = isEnabled;
|
||||
foreach (var item in _edgeslist.Values)
|
||||
item.SetCurrentValue(EdgeControlBase.ShowLabelProperty, isEnabled);
|
||||
item.EdgeLabelControls.Cast<FrameworkElement>().ForEach(l=> l.SetCurrentValue(EdgeLabelControl.ShowLabelProperty, isEnabled));
|
||||
#if WPF
|
||||
InvalidateVisual();
|
||||
#endif
|
||||
|
@ -1399,18 +1406,16 @@ namespace GraphX.Controls
|
|||
#endif
|
||||
}
|
||||
|
||||
private bool? _svAlignEdgeLabels;
|
||||
//private bool? _svAlignEdgeLabels;
|
||||
/// <summary>
|
||||
/// Aligns all labels with edges or displays them horizontaly
|
||||
/// </summary>
|
||||
/// <param name="isEnabled">Boolean value</param>
|
||||
public void AlignAllEdgesLabels(bool isEnabled = true)
|
||||
{
|
||||
_svAlignEdgeLabels = isEnabled;
|
||||
//_svAlignEdgeLabels = isEnabled;
|
||||
foreach (var item in _edgeslist.Values)
|
||||
{
|
||||
item.AlignLabelsToEdges = isEnabled;
|
||||
}
|
||||
item.EdgeLabelControls.ForEach(l=> l.AlignToEdge = isEnabled);
|
||||
#if WPF
|
||||
InvalidateVisual();
|
||||
#endif
|
||||
|
@ -1435,6 +1440,21 @@ namespace GraphX.Controls
|
|||
}
|
||||
}
|
||||
|
||||
private bool? _edgesDragEnabled;
|
||||
/// <summary>
|
||||
/// Sets drag mode for all edges
|
||||
/// </summary>
|
||||
/// <param name="isEnabled">Is drag mode enabled</param>
|
||||
public void SetEdgesDrag(bool isEnabled)
|
||||
{
|
||||
_edgesDragEnabled = isEnabled;
|
||||
|
||||
foreach (var item in EdgesList)
|
||||
{
|
||||
DragBehaviour.SetIsDragEnabled(item.Value, isEnabled);
|
||||
}
|
||||
}
|
||||
|
||||
private VertexShape? _svVertexShape;// = VertexShape.Rectangle;
|
||||
/// <summary>
|
||||
/// Sets math shape for all vertices
|
||||
|
@ -1515,7 +1535,7 @@ namespace GraphX.Controls
|
|||
{
|
||||
if (LogicCore == null)
|
||||
throw new GX_InvalidDataException("LogicCore -> Not initialized!");
|
||||
RemoveAllEdges();
|
||||
RemoveAllEdges();
|
||||
|
||||
AutoresolveEdgeIds();
|
||||
|
||||
|
@ -1524,17 +1544,19 @@ namespace GraphX.Controls
|
|||
if (item.Source == null || item.Target == null) continue;
|
||||
if (!_vertexlist.ContainsKey(item.Source) || !_vertexlist.ContainsKey(item.Target)) continue;
|
||||
var edgectrl = ControlFactory.CreateEdgeControl(_vertexlist[item.Source], _vertexlist[item.Target],
|
||||
item, _svShowEdgeLabels ?? false, _svShowEdgeArrows ?? true, defaultVisibility);
|
||||
item, _svShowEdgeArrows ?? true, defaultVisibility);
|
||||
InternalInsertEdge(item, edgectrl);
|
||||
//setup path
|
||||
if (_svShowEdgeLabels == true)
|
||||
edgectrl.SetCurrentValue(EdgeControlBase.ShowLabelProperty, true);
|
||||
edgectrl.PrepareEdgePath();
|
||||
}
|
||||
|
||||
if (LogicCore.EnableParallelEdges)
|
||||
UpdateParallelEdgesData();
|
||||
|
||||
foreach (var item in _edgeslist)
|
||||
{
|
||||
item.Value.PrepareEdgePath();
|
||||
}
|
||||
|
||||
GenerateEdgeLabels();
|
||||
}
|
||||
|
||||
|
@ -1557,78 +1579,52 @@ namespace GraphX.Controls
|
|||
public virtual void UpdateParallelEdgesData(Dictionary<TEdge, EdgeControl> edgeList = null)
|
||||
{
|
||||
edgeList = edgeList ?? _edgeslist;
|
||||
var usedIds = edgeList.Count > 20 ? new HashSet<long>() as ICollection<long> : new List<long>();
|
||||
|
||||
//clear IsParallel flag
|
||||
edgeList.Values.ForEach(a => a.IsParallel = false);
|
||||
|
||||
foreach (var item in edgeList)
|
||||
// Group edges together that share the same source and target. Edges that have both a source and target connection point defined are excluded. Self
|
||||
// looped edges are excluded. Edges marked with CanBeParallel == false are excluded. Edges with a connection point are pushed to the end of the group
|
||||
// and will be marked as parallel, but their offsets end up overridden during rendering.
|
||||
var edgeGroups =
|
||||
(from edge in edgeList
|
||||
where edge.Value.CanBeParallel && !edge.Key.IsSelfLoop && (!edge.Key.SourceConnectionPointId.HasValue || !edge.Key.TargetConnectionPointId.HasValue)
|
||||
group edge by new Tuple<long, long>(Math.Min(edge.Key.Source.ID, edge.Key.Target.ID), Math.Max(edge.Key.Source.ID, edge.Key.Target.ID)) into edgeGroup
|
||||
select edgeGroup.OrderBy(e => e.Key.SourceConnectionPointId.HasValue || e.Key.TargetConnectionPointId.HasValue ? 1 : 0).ToList())
|
||||
.ToList();
|
||||
|
||||
foreach (var list in edgeGroups)
|
||||
{
|
||||
if (usedIds.Contains(item.Key.ID) || !item.Value.CanBeParallel) continue;
|
||||
var list = new List<EdgeControl> { item.Value };
|
||||
//that list will contain checks for edges that goes form target to source
|
||||
var cList = new List<bool> { false };
|
||||
foreach (var edge in edgeList)
|
||||
var first = list[0];
|
||||
|
||||
// Alternate sides with each step
|
||||
int viceversa = 1;
|
||||
// Check if total number of edges without connection points is even or not
|
||||
bool even = (list.TakeWhile(e => !e.Key.SourceConnectionPointId.HasValue && !e.Key.TargetConnectionPointId.HasValue).Count() % 2) == 0;
|
||||
// For even numbers of edges, initial offset is a half step from the center
|
||||
int initialOffset = even ? LogicCore.ParallelEdgeDistance / 2 : 0;
|
||||
|
||||
for (int i = 0; i < list.Count; i++)
|
||||
{
|
||||
//skip the same edge
|
||||
if (item.Key.ID == edge.Key.ID) continue;
|
||||
//add source to target edge
|
||||
if (edge.Value.CanBeParallel && ((item.Key.Source.ID == edge.Key.Source.ID && item.Key.Target.ID == edge.Key.Target.ID)))
|
||||
var kvp = list[i];
|
||||
kvp.Value.IsParallel = true;
|
||||
|
||||
var offset = viceversa * (initialOffset + LogicCore.ParallelEdgeDistance * ((i + (even ? 0 : 1)) / 2));
|
||||
//if source to target edge
|
||||
if (kvp.Key.Source == first.Key.Source)
|
||||
{
|
||||
list.Add(edge.Value);
|
||||
cList.Add(false);
|
||||
kvp.Value.ParallelEdgeOffset = offset;
|
||||
}
|
||||
//add target to source edge and remember the check
|
||||
if (item.Key.Source.ID == edge.Key.Target.ID && item.Key.Target.ID == edge.Key.Source.ID)
|
||||
else //if target to source edge - just switch offsets
|
||||
{
|
||||
cList.Add(true);
|
||||
list.Add(edge.Value);
|
||||
kvp.Value.ParallelEdgeOffset = -offset;
|
||||
}
|
||||
//else cList.Add(false);
|
||||
//change trigger to opposite
|
||||
viceversa = -viceversa;
|
||||
}
|
||||
|
||||
//do stuff
|
||||
if (list.Count > 1)
|
||||
{
|
||||
//trigger to show in which side to step distance
|
||||
bool viceversa = false;
|
||||
//check if total number of edges is even or not
|
||||
bool even = (list.Count % 2) == 0;
|
||||
//get the resulting step distance for the case
|
||||
int distance = even ? (int)(LogicCore.ParallelEdgeDistance * .5) : LogicCore.ParallelEdgeDistance;
|
||||
|
||||
//leave first edge intact if we have not even edges count
|
||||
for (int i = even ? 0 : 1; i < list.Count; i++)
|
||||
{
|
||||
//if source to target edge
|
||||
if (!cList[i])
|
||||
{
|
||||
list[i].ParallelEdgeOffset = (viceversa ? -distance : distance) * (1 + ((even ? i : i - 1) / 2));
|
||||
//list[i].TargetOffset = -list[i].ParallelEdgeOffset;
|
||||
}
|
||||
else //if target to source edge - just switch offsets
|
||||
{
|
||||
list[i].ParallelEdgeOffset = -((viceversa ? -distance : distance) * (1 + ((even ? i : i - 1) / 2)));
|
||||
//list[i].ParallelEdgeOffset = -list[i].TargetOffset;
|
||||
}
|
||||
//change trigger to opposite
|
||||
viceversa = !viceversa;
|
||||
list[i].IsParallel = true;
|
||||
}
|
||||
}
|
||||
|
||||
//remember used edges IDs
|
||||
list.ForEach(a =>
|
||||
{
|
||||
var edge = a.Edge as TEdge;
|
||||
if (edge != null) usedIds.Add(edge.ID);
|
||||
});
|
||||
list.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region GenerateEdgesForVertex()
|
||||
|
@ -1664,7 +1660,7 @@ namespace GraphX.Controls
|
|||
foreach (var item in inlist)
|
||||
{
|
||||
if (gotSelfLoop) continue;
|
||||
var ctrl = ControlFactory.CreateEdgeControl(_vertexlist[item.Source], vc, item, _svShowEdgeLabels ?? false, _svShowEdgeArrows ?? true,
|
||||
var ctrl = ControlFactory.CreateEdgeControl(_vertexlist[item.Source], vc, item, _svShowEdgeArrows ?? true,
|
||||
defaultVisibility);
|
||||
InsertEdge(item, ctrl);
|
||||
ctrl.PrepareEdgePath();
|
||||
|
@ -1674,7 +1670,7 @@ namespace GraphX.Controls
|
|||
foreach (var item in outlist)
|
||||
{
|
||||
if (gotSelfLoop) continue;
|
||||
var ctrl = ControlFactory.CreateEdgeControl(vc, _vertexlist[item.Target], item, _svShowEdgeLabels ?? false, _svShowEdgeArrows ?? true,
|
||||
var ctrl = ControlFactory.CreateEdgeControl(vc, _vertexlist[item.Target], item, _svShowEdgeArrows ?? true,
|
||||
defaultVisibility);
|
||||
InsertEdge(item, ctrl);
|
||||
ctrl.PrepareEdgePath();
|
||||
|
@ -1742,9 +1738,17 @@ namespace GraphX.Controls
|
|||
}
|
||||
var ec = ctrl as EdgeControl;
|
||||
if (ec == null) return list;
|
||||
|
||||
var edge = (TEdge)ec.Edge;
|
||||
if (_vertexlist.ContainsKey(edge.Target)) list.Add(_vertexlist[edge.Target]);
|
||||
if (_vertexlist.ContainsKey(edge.Source)) list.Add(_vertexlist[edge.Source]);
|
||||
if (edge.Target != null && _vertexlist.ContainsKey(edge.Target))
|
||||
{
|
||||
list.Add(_vertexlist[edge.Target]);
|
||||
}
|
||||
if (edge.Source != null && _vertexlist.ContainsKey(edge.Source))
|
||||
{
|
||||
list.Add(_vertexlist[edge.Source]);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
@ -1785,7 +1789,7 @@ namespace GraphX.Controls
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get controls related to specified control
|
||||
/// Get controls related to specified control
|
||||
/// </summary>
|
||||
/// <param name="ctrl">Original control</param>
|
||||
/// <param name="resultType">Type of resulting related controls</param>
|
||||
|
@ -1871,7 +1875,7 @@ namespace GraphX.Controls
|
|||
foreach (var item in EdgesList)
|
||||
{
|
||||
// item.Key.RoutingPoints = new Point[] { new Point(0, 123), new Point(12, 12), new Point(10, 234.5) };
|
||||
dlist.Add(new GraphSerializationData { Position = new Measure.Point(), Data = item.Key, IsVisible = item.Value.Visibility == Visibility.Visible, HasLabel = item.Value.EdgeLabelControl != null });
|
||||
dlist.Add(new GraphSerializationData { Position = new Measure.Point(), Data = item.Key, IsVisible = item.Value.Visibility == Visibility.Visible, HasLabel = item.Value.EdgeLabelControls.Count > 0 });
|
||||
if (item.Key.ID == -1) throw new GX_InvalidDataException("ExtractSerializationData() -> All edge datas must have positive unique ID!");
|
||||
}
|
||||
return dlist;
|
||||
|
@ -1921,7 +1925,7 @@ namespace GraphX.Controls
|
|||
|
||||
if (datasource == null || datatarget == null)
|
||||
throw new GX_SerializationException("DeserializeFromFile() -> Serialization logic is broken! Vertex not found. All vertices must be processed before edges!");
|
||||
var ecc = ControlFactory.CreateEdgeControl(_vertexlist[datasource], _vertexlist[datatarget], edgedata, false, true, item.IsVisible ? Visibility.Visible : Visibility.Collapsed);
|
||||
var ecc = ControlFactory.CreateEdgeControl(_vertexlist[datasource], _vertexlist[datatarget], edgedata, true, item.IsVisible ? Visibility.Visible : Visibility.Collapsed);
|
||||
InsertEdge(edgedata, ecc);
|
||||
LogicCore.Graph.AddEdge(edgedata);
|
||||
if (item.HasLabel)
|
||||
|
@ -1966,7 +1970,7 @@ namespace GraphX.Controls
|
|||
/// <summary>
|
||||
/// Export current graph layout into the JPEG image file. layout will be saved in full size.
|
||||
/// </summary>
|
||||
/// <param name="quality">Optional image quality parameter</param>
|
||||
/// <param name="quality">Optional image quality parameter</param>
|
||||
public virtual void ExportAsJpeg(int quality = 100)
|
||||
{
|
||||
ExportAsImageDialog(ImageType.JPEG, true, PrintHelper.DEFAULT_DPI, quality);
|
||||
|
@ -1978,7 +1982,7 @@ namespace GraphX.Controls
|
|||
/// <param name="itype">Image format</param>
|
||||
/// <param name="dpi">Optional image DPI parameter</param>
|
||||
/// <param name="useZoomControlSurface">Use zoom control parent surface to render bitmap (only visible zoom content will be exported)</param>
|
||||
/// <param name="quality">Optional image quality parameter (for JPEG)</param>
|
||||
/// <param name="quality">Optional image quality parameter (for JPEG)</param>
|
||||
public virtual void ExportAsImageDialog(ImageType itype, bool useZoomControlSurface = false, double dpi = PrintHelper.DEFAULT_DPI, int quality = 100)
|
||||
{
|
||||
#if WPF
|
||||
|
@ -2030,7 +2034,7 @@ namespace GraphX.Controls
|
|||
}
|
||||
#endif
|
||||
/// <summary>
|
||||
/// Sets GraphArea into printing mode when its size will be recalculated on each measuer and child controls will be arranged accordingly.
|
||||
/// Sets GraphArea into printing mode when its size will be recalculated on each measuer and child controls will be arranged accordingly.
|
||||
/// Use with caution. Can spoil normal work while active but is essential to set before printing or grabbing an image.
|
||||
/// </summary>
|
||||
/// <param name="value">True or False</param>
|
||||
|
@ -2168,7 +2172,7 @@ namespace GraphX.Controls
|
|||
|
||||
protected virtual void CreateNewStateStorage()
|
||||
{
|
||||
_stateStorage = new StateStorage<TVertex, TEdge, TGraph>(this);
|
||||
_stateStorage = new StateStorage<TVertex, TEdge, TGraph>(this);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -2219,9 +2223,19 @@ namespace GraphX.Controls
|
|||
UIElement element = null;
|
||||
if (vResult?.VertexLabelControl != null)
|
||||
element = (UIElement)vResult.VertexLabelControl;
|
||||
if (eResult?.EdgeLabelControl != null)
|
||||
element = (UIElement)eResult.EdgeLabelControl;
|
||||
if (element != null && Children.Contains(element))
|
||||
if (eResult?.EdgeLabelControls.Count > 0)
|
||||
{
|
||||
eResult.EdgeLabelControls.ForEach(l =>
|
||||
{
|
||||
if (Children.Contains((UIElement)l))
|
||||
{
|
||||
Children.Remove((UIElement)l);
|
||||
if (toFront) Children.Add((UIElement)l);
|
||||
else Children.Insert(0, (UIElement)l);
|
||||
}
|
||||
});
|
||||
}
|
||||
else if (element != null && Children.Contains(element))
|
||||
{
|
||||
Children.Remove(element);
|
||||
if (toFront) Children.Add(element);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
#if WPF
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
@ -510,6 +511,15 @@ namespace GraphX
|
|||
/// <returns></returns>
|
||||
public abstract VertexControl[] GetAllVertexControls();
|
||||
|
||||
public abstract VertexControl GetVertexControlAt(Point position);
|
||||
|
||||
#if WPF
|
||||
public abstract void RelayoutGraph(bool generateAllEdges = false);
|
||||
#else
|
||||
public abstract Task RelayoutGraphAsync(bool generateAllEdges = false);
|
||||
|
||||
#endif
|
||||
|
||||
// INTERNAL VARIABLES FOR CONTROLS INTEROPERABILITY
|
||||
internal abstract bool IsEdgeRoutingEnabled { get; }
|
||||
internal abstract bool EnableParallelEdges { get; }
|
||||
|
@ -518,20 +528,20 @@ namespace GraphX
|
|||
|
||||
|
||||
/// <summary>
|
||||
/// Get controls related to specified control
|
||||
/// Get controls related to specified control
|
||||
/// </summary>
|
||||
/// <param name="ctrl">Original control</param>
|
||||
/// <param name="resultType">Type of resulting related controls</param>
|
||||
/// <param name="edgesType">Optional edge controls type</param>
|
||||
public abstract List<IGraphControl> GetRelatedControls(IGraphControl ctrl, GraphControlType resultType = GraphControlType.VertexAndEdge, EdgesType edgesType = EdgesType.Out);
|
||||
/// <summary>
|
||||
/// Get vertex controls related to specified control
|
||||
/// Get vertex controls related to specified control
|
||||
/// </summary>
|
||||
/// <param name="ctrl">Original control</param>
|
||||
/// <param name="edgesType">Edge types to query for vertices</param>
|
||||
public abstract List<IGraphControl> GetRelatedVertexControls(IGraphControl ctrl, EdgesType edgesType = EdgesType.All);
|
||||
/// <summary>
|
||||
/// Get edge controls related to specified control
|
||||
/// Get edge controls related to specified control
|
||||
/// </summary>
|
||||
/// <param name="ctrl">Original control</param>
|
||||
/// <param name="edgesType">Edge types to query</param>
|
||||
|
@ -641,11 +651,11 @@ namespace GraphX
|
|||
return DesignerProperties.GetIsInDesignMode(this) ? DesignSize : (IsInPrintMode ? ContentSize.Size : new Size(10, 10));
|
||||
#elif METRO
|
||||
return DesignMode.DesignModeEnabled ? DesignSize : new Size(10, 10);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overridden measure. It calculates a size where all of
|
||||
/// Overridden measure. It calculates a size where all of
|
||||
/// of the vertices are visible.
|
||||
/// </summary>
|
||||
/// <param name="constraint">The size constraint.</param>
|
||||
|
@ -660,7 +670,7 @@ namespace GraphX
|
|||
foreach (UIElement child in InternalChildren)
|
||||
#elif METRO
|
||||
foreach (UIElement child in Children)
|
||||
#endif
|
||||
#endif
|
||||
{
|
||||
//measure the child
|
||||
child.Measure(constraint);
|
||||
|
|
|
@ -9,6 +9,22 @@ namespace GraphX.Controls
|
|||
{
|
||||
public interface IEdgeLabelControl: IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets if label should be aligned with the edge
|
||||
/// </summary>
|
||||
bool AlignToEdge { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets if label is visible
|
||||
/// </summary>
|
||||
bool ShowLabel { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets label vertical offset
|
||||
/// </summary>
|
||||
double LabelVerticalOffset { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets label horizontal offset
|
||||
/// </summary>
|
||||
double LabelHorizontalOffset { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets label drawing angle in degrees
|
||||
/// </summary>
|
||||
|
|
|
@ -11,7 +11,12 @@ using Windows.UI.Xaml;
|
|||
namespace GraphX.Controls
|
||||
{
|
||||
public interface IEdgePointer: IDisposable
|
||||
{
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns edge pointer center position coordinates
|
||||
/// </summary>
|
||||
Point GetPosition();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets if image has to be rotated according to edge directions
|
||||
/// </summary>
|
||||
|
|
|
@ -1,14 +1,17 @@
|
|||
#if WPF
|
||||
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
|
||||
#elif METRO
|
||||
using Windows.Foundation;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Media;
|
||||
#endif
|
||||
|
||||
using GraphX.PCL.Common.Enums;
|
||||
|
||||
namespace GraphX.Controls
|
||||
|
@ -22,11 +25,10 @@ namespace GraphX.Controls
|
|||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
|
||||
public static readonly DependencyProperty ShapeProperty =
|
||||
DependencyProperty.Register(nameof(Shape),
|
||||
typeof(VertexShape),
|
||||
typeof(StaticVertexConnectionPoint),
|
||||
DependencyProperty.Register(nameof(Shape),
|
||||
typeof(VertexShape),
|
||||
typeof(StaticVertexConnectionPoint),
|
||||
new PropertyMetadata(VertexShape.Circle));
|
||||
|
||||
/// <summary>
|
||||
|
@ -38,12 +40,13 @@ namespace GraphX.Controls
|
|||
set { SetValue(ShapeProperty, value); }
|
||||
}
|
||||
|
||||
|
||||
private Rect _rectangularSize;
|
||||
public Rect RectangularSize {
|
||||
get
|
||||
{
|
||||
if(_rectangularSize == Rect.Empty)
|
||||
|
||||
public Rect RectangularSize
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_rectangularSize == Rect.Empty)
|
||||
UpdateLayout();
|
||||
return _rectangularSize;
|
||||
}
|
||||
|
@ -79,7 +82,7 @@ namespace GraphX.Controls
|
|||
return null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion Common part
|
||||
|
||||
private VertexControl _vertexControl;
|
||||
protected VertexControl VertexControl => _vertexControl ?? (_vertexControl = GetVertexControl(GetParent()));
|
||||
|
@ -101,7 +104,9 @@ namespace GraphX.Controls
|
|||
{
|
||||
_vertexControl = null;
|
||||
}
|
||||
|
||||
#if WPF
|
||||
|
||||
public DependencyObject GetParent()
|
||||
{
|
||||
return VisualParent;
|
||||
|
@ -112,8 +117,9 @@ namespace GraphX.Controls
|
|||
var position = TranslatePoint(new Point(), VertexControl);
|
||||
var vPos = VertexControl.GetPosition();
|
||||
position = new Point(position.X + vPos.X, position.Y + vPos.Y);
|
||||
RectangularSize = new Rect(position, DesiredSize);
|
||||
RectangularSize = new Rect(position, new Size(ActualWidth, ActualHeight));
|
||||
}
|
||||
|
||||
#elif METRO
|
||||
public DependencyObject GetParent()
|
||||
{
|
||||
|
@ -129,4 +135,4 @@ namespace GraphX.Controls
|
|||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,10 +1,13 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
|
||||
#if WPF
|
||||
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Controls;
|
||||
|
||||
#elif METRO
|
||||
using MouseEventArgs = Windows.UI.Xaml.Input.PointerRoutedEventArgs;
|
||||
using MouseButtonEventArgs = Windows.UI.Xaml.Input.PointerRoutedEventArgs;
|
||||
|
@ -12,18 +15,19 @@ using Windows.UI.Xaml;
|
|||
using Windows.UI.Xaml.Data;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
#endif
|
||||
|
||||
using GraphX.PCL.Common.Enums;
|
||||
using GraphX.PCL.Common.Exceptions;
|
||||
using GraphX.Controls.Models;
|
||||
using GraphX.PCL.Common.Interfaces;
|
||||
|
||||
|
||||
namespace GraphX.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// Visual vertex control
|
||||
/// </summary>
|
||||
#if WPF
|
||||
|
||||
[Serializable]
|
||||
#endif
|
||||
[TemplateVisualState(GroupName = "CommonStates", Name = "Normal")]
|
||||
|
@ -33,9 +37,10 @@ namespace GraphX.Controls
|
|||
[TemplateVisualState(GroupName = "CommonStates", Name = "Disabled")]
|
||||
[TemplatePart(Name = "PART_vertexLabel", Type = typeof(IVertexLabelControl))]
|
||||
[TemplatePart(Name = "PART_vcproot", Type = typeof(Panel))]
|
||||
public class VertexControl: VertexControlBase
|
||||
public class VertexControl : VertexControlBase
|
||||
{
|
||||
#if WPF
|
||||
|
||||
static VertexControl()
|
||||
{
|
||||
//override the StyleKey Property
|
||||
|
@ -54,16 +59,15 @@ namespace GraphX.Controls
|
|||
Vertex = vertexData;
|
||||
|
||||
EventOptions = new VertexEventOptions(this) { PositionChangeNotification = tracePositionChange };
|
||||
foreach(var item in Enum.GetValues(typeof(EventType)).Cast<EventType>())
|
||||
foreach (var item in Enum.GetValues(typeof(EventType)).Cast<EventType>())
|
||||
UpdateEventhandling(item);
|
||||
}
|
||||
|
||||
|
||||
#region Position trace feature
|
||||
|
||||
|
||||
private ChangeMonitor _xChangeMonitor;
|
||||
private ChangeMonitor _yChangeMonitor;
|
||||
|
||||
internal void UpdatePositionTraceState()
|
||||
{
|
||||
if (EventOptions.PositionChangeNotification)
|
||||
|
@ -100,12 +104,12 @@ namespace GraphX.Controls
|
|||
|
||||
private void changeMonitor_ChangeDetected(object source, EventArgs args)
|
||||
{
|
||||
if(ShowLabel)
|
||||
if (ShowLabel)
|
||||
VertexLabelControl?.UpdatePosition();
|
||||
OnPositionChanged(new Point(), GetPosition());
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion Position trace feature
|
||||
|
||||
public T FindDescendant<T>(string name)
|
||||
{
|
||||
|
@ -115,7 +119,7 @@ namespace GraphX.Controls
|
|||
#region Event tracing
|
||||
|
||||
private bool _clickTrack;
|
||||
private Point _clickTrackPoint;
|
||||
private Point _clickTrackPoint;
|
||||
|
||||
internal void UpdateEventhandling(EventType typ)
|
||||
{
|
||||
|
@ -133,22 +137,27 @@ namespace GraphX.Controls
|
|||
PreviewMouseMove -= VertexControl_PreviewMouseMove;
|
||||
}
|
||||
break;
|
||||
|
||||
case EventType.MouseDoubleClick:
|
||||
if (EventOptions.MouseDoubleClickEnabled) MouseDoubleClick += VertexControl_MouseDoubleClick;
|
||||
else MouseDoubleClick -= VertexControl_MouseDoubleClick;
|
||||
break;
|
||||
|
||||
case EventType.MouseMove:
|
||||
if (EventOptions.MouseMoveEnabled) MouseMove += VertexControl_MouseMove;
|
||||
else MouseMove -= VertexControl_MouseMove;
|
||||
break;
|
||||
|
||||
case EventType.MouseEnter:
|
||||
if (EventOptions.MouseEnterEnabled) MouseEnter += VertexControl_MouseEnter;
|
||||
else MouseEnter -= VertexControl_MouseEnter;
|
||||
break;
|
||||
|
||||
case EventType.MouseLeave:
|
||||
if (EventOptions.MouseLeaveEnabled) MouseLeave += VertexControl_MouseLeave;
|
||||
else MouseLeave -= VertexControl_MouseLeave;
|
||||
break;
|
||||
|
||||
case EventType.PositionChangeNotify:
|
||||
UpdatePositionTraceState();
|
||||
break;
|
||||
|
@ -157,18 +166,18 @@ namespace GraphX.Controls
|
|||
MouseUp += VertexControl_MouseUp;
|
||||
}
|
||||
|
||||
void VertexControl_PreviewMouseMove(object sender, MouseEventArgs e)
|
||||
private void VertexControl_PreviewMouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (!_clickTrack)
|
||||
return;
|
||||
if (!_clickTrack)
|
||||
return;
|
||||
|
||||
var curPoint = RootArea != null ? Mouse.GetPosition(RootArea) : new Point();
|
||||
|
||||
if (curPoint != _clickTrackPoint)
|
||||
_clickTrack = false;
|
||||
if (curPoint != _clickTrackPoint)
|
||||
_clickTrack = false;
|
||||
}
|
||||
|
||||
void VertexControl_MouseUp(object sender, MouseButtonEventArgs e)
|
||||
private void VertexControl_MouseUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (RootArea != null && Visibility == Visibility.Visible)
|
||||
{
|
||||
|
@ -183,33 +192,35 @@ namespace GraphX.Controls
|
|||
e.Handled = true;
|
||||
}
|
||||
|
||||
void VertexControl_MouseDoubleClick(object sender, MouseButtonEventArgs e)
|
||||
private void VertexControl_MouseDoubleClick(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (RootArea != null && Visibility == Visibility.Visible)
|
||||
RootArea.OnVertexDoubleClick(this, e);
|
||||
//e.Handled = true;
|
||||
}
|
||||
|
||||
void VertexControl_Down(object sender, MouseButtonEventArgs e)
|
||||
private void VertexControl_Down(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (RootArea != null && Visibility == Visibility.Visible)
|
||||
RootArea.OnVertexSelected(this, e, Keyboard.Modifiers);
|
||||
if (RootArea != null && Visibility == Visibility.Visible)
|
||||
RootArea.OnVertexSelected(this, e, Keyboard.Modifiers);
|
||||
_clickTrack = true;
|
||||
_clickTrackPoint = RootArea != null ? Mouse.GetPosition(RootArea) : new Point();
|
||||
_clickTrackPoint = RootArea != null ? Mouse.GetPosition(RootArea) : new Point();
|
||||
e.Handled = true;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion Event tracing
|
||||
|
||||
#region Click Event
|
||||
|
||||
public static readonly RoutedEvent ClickEvent = EventManager.RegisterRoutedEvent(nameof(Click), RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(VertexControl));
|
||||
|
||||
public event RoutedEventHandler Click
|
||||
{
|
||||
add { AddHandler(ClickEvent, value); }
|
||||
remove { RemoveHandler(ClickEvent, value); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion Click Event
|
||||
|
||||
#region ChangeMonitor class
|
||||
|
||||
|
@ -259,9 +270,12 @@ namespace GraphX.Controls
|
|||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion ChangeMonitor class
|
||||
|
||||
#elif METRO
|
||||
|
||||
#region Attached property tracer
|
||||
|
||||
private static readonly DependencyProperty TestXProperty =
|
||||
DependencyProperty.Register("TestX", typeof(double), typeof(VertexControl), new PropertyMetadata(0, Testxchanged));
|
||||
|
||||
|
@ -281,7 +295,8 @@ namespace GraphX.Controls
|
|||
if (vc != null)
|
||||
vc.OnPositionChanged();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion Attached property tracer
|
||||
|
||||
/// <summary>
|
||||
/// Create vertex visual control
|
||||
|
@ -327,18 +342,22 @@ namespace GraphX.Controls
|
|||
if (EventOptions.MouseClickEnabled) PointerPressed += VertexControl_Down;
|
||||
else PointerPressed -= VertexControl_Down;
|
||||
break;
|
||||
|
||||
case EventType.MouseDoubleClick:
|
||||
// if (EventOptions.MouseDoubleClickEnabled) Poi += VertexControl_MouseDoubleClick;
|
||||
// else MouseDoubleClick -= VertexControl_MouseDoubleClick;
|
||||
break;
|
||||
|
||||
case EventType.MouseMove:
|
||||
if (EventOptions.MouseMoveEnabled) PointerMoved += VertexControl_MouseMove;
|
||||
else PointerMoved -= VertexControl_MouseMove;
|
||||
break;
|
||||
|
||||
case EventType.MouseEnter:
|
||||
if (EventOptions.MouseEnterEnabled) PointerEntered += VertexControl_MouseEnter;
|
||||
else PointerEntered -= VertexControl_MouseEnter;
|
||||
break;
|
||||
|
||||
case EventType.MouseLeave:
|
||||
if (EventOptions.MouseLeaveEnabled) PointerExited += VertexControl_MouseLeave;
|
||||
else PointerExited -= VertexControl_MouseLeave;
|
||||
|
@ -355,14 +374,14 @@ namespace GraphX.Controls
|
|||
}
|
||||
#endif
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets the root element which hosts VCPs so you can add them at runtime. Requires Panel-descendant template item defined named PART_vcproot.
|
||||
/// </summary>
|
||||
public Panel VCPRoot { get; protected set; }
|
||||
|
||||
#if WPF
|
||||
public
|
||||
|
||||
public
|
||||
#elif METRO
|
||||
protected
|
||||
#endif
|
||||
|
@ -377,7 +396,7 @@ namespace GraphX.Controls
|
|||
|
||||
if (VertexLabelControl != null)
|
||||
{
|
||||
if(ShowLabel) VertexLabelControl.Show(); else VertexLabelControl.Hide();
|
||||
if (ShowLabel) VertexLabelControl.Show(); else VertexLabelControl.Hide();
|
||||
UpdateLayout();
|
||||
VertexLabelControl.UpdatePosition();
|
||||
}
|
||||
|
@ -387,31 +406,29 @@ namespace GraphX.Controls
|
|||
throw new GX_InvalidDataException("Vertex connection points in VertexControl template must have unique Id!");
|
||||
}
|
||||
|
||||
#region Events handling
|
||||
#region Events handling
|
||||
|
||||
|
||||
|
||||
void VertexControl_MouseLeave(object sender, MouseEventArgs e)
|
||||
private void VertexControl_MouseLeave(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (RootArea != null && Visibility == Visibility.Visible)
|
||||
RootArea.OnVertexMouseLeave(this, e);
|
||||
VisualStateManager.GoToState(this, "PointerLeave", true);
|
||||
}
|
||||
|
||||
void VertexControl_MouseEnter(object sender, MouseEventArgs e)
|
||||
private void VertexControl_MouseEnter(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (RootArea != null && Visibility == Visibility.Visible)
|
||||
RootArea.OnVertexMouseEnter(this, e);
|
||||
VisualStateManager.GoToState(this, "PointerOver", true);
|
||||
}
|
||||
|
||||
void VertexControl_MouseMove(object sender, MouseEventArgs e)
|
||||
private void VertexControl_MouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (RootArea != null)
|
||||
RootArea.OnVertexMouseMove(this, e);
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion Events handling
|
||||
|
||||
/// <summary>
|
||||
/// Cleans all potential memory-holding code
|
||||
|
@ -440,6 +457,6 @@ namespace GraphX.Controls
|
|||
public T GetDataVertex<T>() where T : IGraphXVertex
|
||||
{
|
||||
return (T)Vertex;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -4,14 +4,18 @@ using System.Linq;
|
|||
#if WPF
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using USize = System.Windows.Size;
|
||||
using Point = System.Windows.Point;
|
||||
#elif METRO
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.Foundation;
|
||||
using USize = Windows.Foundation.Size;
|
||||
#endif
|
||||
using GraphX.Controls.Models;
|
||||
using GraphX.PCL.Common;
|
||||
using GraphX.PCL.Common.Enums;
|
||||
using Rect = GraphX.Measure.Rect;
|
||||
|
||||
namespace GraphX.Controls
|
||||
{
|
||||
|
@ -197,7 +201,9 @@ namespace GraphX.Controls
|
|||
/// <param name="round"></param>
|
||||
public Point GetPosition(bool final = false, bool round = false)
|
||||
{
|
||||
return round ? new Point(final ? (int)GraphAreaBase.GetFinalX(this) : (int)GraphAreaBase.GetX(this), final ? (int)GraphAreaBase.GetFinalY(this) : (int)GraphAreaBase.GetY(this)) : new Point(final ? GraphAreaBase.GetFinalX(this) : GraphAreaBase.GetX(this), final ? GraphAreaBase.GetFinalY(this) : GraphAreaBase.GetY(this));
|
||||
return round ?
|
||||
new Point(final ? (int)GraphAreaBase.GetFinalX(this) : (int)GraphAreaBase.GetX(this), final ? (int)GraphAreaBase.GetFinalY(this) : (int)GraphAreaBase.GetY(this)) :
|
||||
new Point(final ? GraphAreaBase.GetFinalX(this) : GraphAreaBase.GetX(this), final ? GraphAreaBase.GetFinalY(this) : GraphAreaBase.GetY(this));
|
||||
}
|
||||
/// <summary>
|
||||
/// Get control position on the GraphArea panel in attached coords X and Y (GraphX type version)
|
||||
|
@ -232,6 +238,17 @@ namespace GraphX.Controls
|
|||
return result;
|
||||
}
|
||||
|
||||
public IVertexConnectionPoint GetConnectionPointAt(Point position)
|
||||
{
|
||||
Measure(new USize(double.PositiveInfinity, double.PositiveInfinity));
|
||||
|
||||
return VertexConnectionPointsList.FirstOrDefault(a =>
|
||||
{
|
||||
var rect = new Rect(a.RectangularSize.X, a.RectangularSize.Y, a.RectangularSize.Width, a.RectangularSize.Height);
|
||||
return rect.Contains(position.ToGraphX());
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Internal method. Attaches label to control
|
||||
/// </summary>
|
||||
|
|
|
@ -1240,7 +1240,7 @@ namespace GraphX.Controls
|
|||
_startedAsAreaSelection = false;
|
||||
|
||||
OnAreaSelected(ToContentRectangle(ZoomBox));
|
||||
ZoomBox = Rect.Empty;
|
||||
ZoomBox = new Rect();
|
||||
}
|
||||
else ZoomToInternal(ZoomBox);
|
||||
break;
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
using System;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
#if WPF
|
||||
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using System.ComponentModel;
|
||||
|
||||
#elif METRO
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Media;
|
||||
|
@ -49,6 +52,7 @@ namespace GraphX.Controls
|
|||
{
|
||||
return element;
|
||||
}
|
||||
|
||||
var childCount = VisualTreeHelper.GetChildrenCount(element);
|
||||
for (int i = 0; i < childCount; i++)
|
||||
{
|
||||
|
@ -66,6 +70,5 @@ namespace GraphX.Controls
|
|||
return DesignMode.DesignModeEnabled;
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -33,28 +33,29 @@ namespace GraphX.Controls
|
|||
/// <returns></returns>
|
||||
public static Vector? Intersects(Vector a1, Vector a2, Vector b1, Vector b2)
|
||||
{
|
||||
var b = a2 - a1;
|
||||
var d = b2 - b1;
|
||||
var bDotDPerp = b.X * d.Y - b.Y * d.X;
|
||||
var a = a2 - a1;
|
||||
var b = b2 - b1;
|
||||
var aDotBPerp = a.X * b.Y - a.Y * b.X;
|
||||
|
||||
// if b dot d == 0, it means the lines are parallel so have infinite intersection points
|
||||
if (bDotDPerp == 0)
|
||||
// if a dot b == 0, it means the lines are parallel so have infinite intersection points
|
||||
if (aDotBPerp == 0)
|
||||
return null;
|
||||
|
||||
var c = b1 - a1;
|
||||
var t = (c.X * d.Y - c.Y * d.X) / bDotDPerp;
|
||||
if (t < 0 || t > 1)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var u = (c.X * b.Y - c.Y * b.X) / bDotDPerp;
|
||||
// The intersection must fall within the line segment defined by the b1 and b2 endpoints.
|
||||
var u = (c.X * a.Y - c.Y * a.X) / aDotBPerp;
|
||||
if (u < 0 || u > 1)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return a1 + t * b;
|
||||
// The intersection point IS allowed to fall outside of the line segment defined by the a1 and a2
|
||||
// endpoints, anywhere along the infinite line. When this is used to find the intersection of an
|
||||
// Edge as line a and Vertex side as line b, it allows the Edge to be elongated to the intersection.
|
||||
var t = (c.X * b.Y - c.Y * b.X) / aDotBPerp;
|
||||
|
||||
return a1 + t * a;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -376,30 +377,45 @@ namespace GraphX.Controls
|
|||
|
||||
public static Point GetEdgeEndpointOnRectangle(Point sourcePos, Rect sourceBounds, Point targetPos, double angle = 0)
|
||||
{
|
||||
var tgt_pt = targetPos;
|
||||
if (angle != 0)
|
||||
tgt_pt = MathHelper.RotatePoint(targetPos, sourceBounds.Center(), -angle);
|
||||
Func<Point, double, Point> rotate = (p, a) => angle == 0.0 ? p : MathHelper.RotatePoint(p, sourceBounds.Center(), a);
|
||||
|
||||
var leftSide = Intersects(sourcePos.ToVector(), tgt_pt.ToVector(), sourceBounds.TopLeft().ToVector(), sourceBounds.BottomLeft().ToVector());
|
||||
var bottomSide = Intersects(sourcePos.ToVector(), tgt_pt.ToVector(), sourceBounds.BottomLeft().ToVector(), sourceBounds.BottomRight().ToVector());
|
||||
var rightSide = Intersects(sourcePos.ToVector(), tgt_pt.ToVector(), sourceBounds.TopRight().ToVector(), sourceBounds.BottomRight().ToVector());
|
||||
var topSide = Intersects(sourcePos.ToVector(), tgt_pt.ToVector(), sourceBounds.TopLeft().ToVector(), sourceBounds.TopRight().ToVector());
|
||||
var tgt_pt = rotate(targetPos, -angle);
|
||||
|
||||
var pt = new Point(sourcePos.X, sourcePos.Y);
|
||||
if (tgt_pt.X <= sourcePos.X)
|
||||
{
|
||||
var leftSide = Intersects(sourcePos.ToVector(), tgt_pt.ToVector(), sourceBounds.TopLeft().ToVector(), sourceBounds.BottomLeft().ToVector());
|
||||
if (leftSide.HasValue)
|
||||
{
|
||||
return rotate(new Point(leftSide.Value.X, leftSide.Value.Y), angle);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var rightSide = Intersects(sourcePos.ToVector(), tgt_pt.ToVector(), sourceBounds.TopRight().ToVector(), sourceBounds.BottomRight().ToVector());
|
||||
if (rightSide.HasValue)
|
||||
{
|
||||
return rotate(new Point(rightSide.Value.X, rightSide.Value.Y), angle);
|
||||
}
|
||||
}
|
||||
|
||||
// Get the rectangle side where intersection of the proposed Edge path occurred.
|
||||
if (leftSide != null)
|
||||
pt = new Point(leftSide.Value.X, leftSide.Value.Y);
|
||||
else if (bottomSide != null)
|
||||
pt = new Point(bottomSide.Value.X, bottomSide.Value.Y);
|
||||
else if (rightSide != null)
|
||||
pt = new Point(rightSide.Value.X, rightSide.Value.Y);
|
||||
else if (topSide != null)
|
||||
pt = new Point(topSide.Value.X, topSide.Value.Y);
|
||||
if (tgt_pt.Y <= sourcePos.Y)
|
||||
{
|
||||
var topSide = Intersects(sourcePos.ToVector(), tgt_pt.ToVector(), sourceBounds.TopLeft().ToVector(), sourceBounds.TopRight().ToVector());
|
||||
if (topSide.HasValue)
|
||||
{
|
||||
return rotate(new Point(topSide.Value.X, topSide.Value.Y), angle);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var bottomSide = Intersects(sourcePos.ToVector(), tgt_pt.ToVector(), sourceBounds.BottomLeft().ToVector(), sourceBounds.BottomRight().ToVector());
|
||||
if (bottomSide.HasValue)
|
||||
{
|
||||
return rotate(new Point(bottomSide.Value.X, bottomSide.Value.Y), angle);
|
||||
}
|
||||
}
|
||||
|
||||
if ((leftSide != null || bottomSide != null || rightSide != null || topSide != null) && angle != 0)
|
||||
pt = MathHelper.RotatePoint(pt, sourceBounds.Center(), angle);
|
||||
return pt;
|
||||
return rotate(new Point(sourcePos.X, sourcePos.Y), angle);
|
||||
}
|
||||
|
||||
public static PathFigure GenerateOldArrow(Point ip1, Point ip2)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System.Windows;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows;
|
||||
#if METRO
|
||||
using Windows.UI.Xaml;
|
||||
#endif
|
||||
|
@ -16,12 +17,12 @@ namespace GraphX.Controls.Models
|
|||
/// Returns newly generated label for parent control. Attachable labels will be auto attached if derived from IAttachableControl<TCtrl>
|
||||
/// </summary>
|
||||
/// <param name="control">Parent control</param>
|
||||
public virtual TLabel CreateLabel<TCtrl>(TCtrl control)
|
||||
public virtual IEnumerable<TLabel> CreateLabel<TCtrl>(TCtrl control)
|
||||
{
|
||||
var label = new TLabel();
|
||||
var aLabel = label as IAttachableControl<TCtrl>;
|
||||
aLabel?.Attach(control);
|
||||
return label;
|
||||
return new List<TLabel> {label};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -16,9 +16,9 @@ namespace GraphX.Controls.Models
|
|||
FactoryRootArea = graphArea;
|
||||
}
|
||||
|
||||
public virtual EdgeControl CreateEdgeControl(VertexControl source, VertexControl target, object edge, bool showLabels = false, bool showArrows = true, Visibility visibility = Visibility.Visible)
|
||||
public virtual EdgeControl CreateEdgeControl(VertexControl source, VertexControl target, object edge, bool showArrows = true, Visibility visibility = Visibility.Visible)
|
||||
{
|
||||
var edgectrl = new EdgeControl(source, target, edge, showLabels, showArrows) { RootArea = FactoryRootArea};
|
||||
var edgectrl = new EdgeControl(source, target, edge, showArrows) { RootArea = FactoryRootArea};
|
||||
edgectrl.SetCurrentValue(UIElement.VisibilityProperty, visibility);
|
||||
return edgectrl;
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ namespace GraphX.Controls.Models
|
|||
{
|
||||
public interface IGraphControlFactory
|
||||
{
|
||||
EdgeControl CreateEdgeControl(VertexControl source, VertexControl target, object edge, bool showLabels = false, bool showArrows = true, Visibility visibility = Visibility.Visible);
|
||||
EdgeControl CreateEdgeControl(VertexControl source, VertexControl target, object edge, bool showArrows = true, Visibility visibility = Visibility.Visible);
|
||||
VertexControl CreateVertexControl(object vertexData);
|
||||
/// <summary>
|
||||
/// Root graph area for the factory
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System.Windows;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows;
|
||||
#if METRO
|
||||
using Windows.UI.Xaml;
|
||||
#endif
|
||||
|
@ -15,6 +16,6 @@ namespace GraphX.Controls.Models
|
|||
/// Returns newly generated label for parent control. Attachable labels will be auto attached if derived from IAttachableControl<T>
|
||||
/// </summary>
|
||||
/// <param name="control">Parent control</param>
|
||||
TResult CreateLabel<TCtrl>(TCtrl control);
|
||||
IEnumerable<TResult> CreateLabel<TCtrl>(TCtrl control);
|
||||
}
|
||||
}
|
|
@ -31,7 +31,7 @@ namespace GraphX.Controls
|
|||
/// <param name="imgdpi">Desired DPI</param>
|
||||
/// <param name="dpiStep">DPI decrease step while estimating</param>
|
||||
/// <param name="estPixelCount">Pixel quantity threshold</param>
|
||||
public static double CalculateEstimatedDPI(IGraphAreaBase vis, double imgdpi, double dpiStep, int estPixelCount)
|
||||
public static double CalculateEstimatedDPI(IGraphAreaBase vis, double imgdpi, double dpiStep, ulong estPixelCount)
|
||||
{
|
||||
bool result = false;
|
||||
double currentDPI = imgdpi;
|
||||
|
@ -46,10 +46,10 @@ namespace GraphX.Controls
|
|||
}
|
||||
|
||||
|
||||
private static int CalulateSize(Size desiredSize, double dpi)
|
||||
private static ulong CalulateSize(Size desiredSize, double dpi)
|
||||
{
|
||||
return (int) (desiredSize.Width*(dpi/DEFAULT_DPI) + 100) *
|
||||
(int) (desiredSize.Height*(dpi/DEFAULT_DPI) + 100);
|
||||
return (ulong) (desiredSize.Width*(dpi/DEFAULT_DPI) + 100) *
|
||||
(ulong) (desiredSize.Height*(dpi/DEFAULT_DPI) + 100);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -503,7 +503,6 @@
|
|||
Height="10"/>
|
||||
</graphx:DefaultEdgePointer>
|
||||
|
||||
<graphx:EdgeLabelControl x:Name="PART_edgeLabel" Content="{Binding Edge, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
<Path x:Name="PART_SelfLoopedEdge"
|
||||
Width="10"
|
||||
Height="10"
|
||||
|
@ -517,9 +516,8 @@
|
|||
|
||||
<!-- AVAILABLE CUSTOM PROPERTIES -->
|
||||
<!--
|
||||
<Setter Property="LabelVerticalOffset" Value="30"/>
|
||||
<Setter Property="DashStyle" Value="Solid"/>
|
||||
<Setter Property="ShowLabel" Value="True"/> -->
|
||||
-->
|
||||
|
||||
<Setter Property="Foreground"
|
||||
Value="Black" />
|
||||
|
@ -529,23 +527,10 @@
|
|||
<!-- ENDREGION -->
|
||||
|
||||
<!-- REGION EDGE LABLE CONTROL -->
|
||||
<Style TargetType="{x:Type graphx:EdgeLabelControl}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type graphx:EdgeLabelControl}">
|
||||
<Grid>
|
||||
<Border BorderBrush="Black" BorderThickness="1" Background="White" CornerRadius="8">
|
||||
<ContentPresenter Margin="3"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
||||
<Setter Property="DisplayForSelfLoopedEdges" Value="False"/>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="{x:Type graphx:AttachableEdgeLabelControl}">
|
||||
<Setter Property="ShowLabel" Value="True"/>
|
||||
<Setter Property="LabelVerticalOffset" Value="0"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type graphx:AttachableEdgeLabelControl}">
|
||||
|
|
|
@ -1,108 +1,109 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{66F33708-C1C7-4385-8235-7201784D184C}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>GraphX.Controls</RootNamespace>
|
||||
<AssemblyName>GraphX.Controls</AssemblyName>
|
||||
<DefaultLanguage>en-US</DefaultLanguage>
|
||||
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
|
||||
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.14393.0</TargetPlatformVersion>
|
||||
<TargetPlatformMinVersion>10.0.10586.0</TargetPlatformMinVersion>
|
||||
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
||||
<RestorePackages>true</RestorePackages>
|
||||
<TargetPlatformIdentifier>Windows</TargetPlatformIdentifier>
|
||||
<TargetPlatformVersion>8.1</TargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;NETFX_CORE, METRO;NETFX_CORE;WINDOWS_APP</DefineConstants>
|
||||
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<GenerateLibraryLayout>false</GenerateLibraryLayout>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>none</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NETFX_CORE, METRO;NETFX_CORE;WINDOWS_APP</DefineConstants>
|
||||
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\ARM\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_APP</DefineConstants>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>ARM</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
|
||||
<OutputPath>bin\ARM\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_APP</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>ARM</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_APP</DefineConstants>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_APP</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_APP</DefineConstants>
|
||||
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_APP</DefineConstants>
|
||||
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
|
||||
<PlatformTarget>ARM</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\ARM\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>ARM</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
|
||||
<PlatformTarget>ARM</PlatformTarget>
|
||||
<OutputPath>bin\ARM\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>ARM</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>;2008</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
|
||||
|
@ -352,8 +353,8 @@
|
|||
<Private>True</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '12.0' ">
|
||||
<VisualStudioVersion>12.0</VisualStudioVersion>
|
||||
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' ">
|
||||
<VisualStudioVersion>14.0</VisualStudioVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
|
|
|
@ -10,11 +10,11 @@
|
|||
/// Gets or sets source vertex
|
||||
/// </summary>
|
||||
new TVertex Source { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets target vertex
|
||||
/// </summary>
|
||||
new TVertex Target { get; set; }
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -26,33 +26,36 @@
|
|||
/// Gets or sets source vertex
|
||||
/// </summary>
|
||||
new IGraphXVertex Source { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets target vertex
|
||||
/// </summary>
|
||||
new IGraphXVertex Target { get; set; }
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Core edge data interface
|
||||
/// </summary>
|
||||
public interface IGraphXCommonEdge: IIdentifiableGraphDataObject, IRoutingInfo
|
||||
public interface IGraphXCommonEdge : IIdentifiableGraphDataObject, IRoutingInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets if edge is self-looped
|
||||
/// </summary>
|
||||
bool IsSelfLoop { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Optional parameter to bind edge to static vertex connection point
|
||||
/// </summary>
|
||||
int? SourceConnectionPointId { get; }
|
||||
int? SourceConnectionPointId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Optional parameter to bind edge to static vertex connection point
|
||||
/// </summary>
|
||||
int? TargetConnectionPointId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Reverse the calculated routing path points.
|
||||
/// </summary>
|
||||
bool ReversePath { get; set; }}
|
||||
}
|
||||
int? TargetConnectionPointId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Reverse the calculated routing path points.
|
||||
/// </summary>
|
||||
bool ReversePath { get; set; }
|
||||
}
|
||||
}
|
|
@ -24,7 +24,7 @@ namespace GraphX.PCL.Logic.Algorithms.LayoutAlgorithms
|
|||
public SimpleTreeLayoutAlgorithm( TGraph visitedGraph, IDictionary<TVertex, Point> vertexPositions, IDictionary<TVertex, Size> vertexSizes, SimpleTreeLayoutParameters parameters )
|
||||
: base( visitedGraph, vertexPositions, parameters )
|
||||
{
|
||||
VertexSizes = new Dictionary<TVertex, Size>(vertexSizes);
|
||||
VertexSizes = vertexSizes == null ? new Dictionary<TVertex, Size>() : new Dictionary<TVertex, Size>(vertexSizes);
|
||||
}
|
||||
|
||||
public override void Compute(CancellationToken cancellationToken)
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
using System;
|
||||
using Windows.UI.Xaml.Data;
|
||||
|
||||
namespace GraphX.Controls
|
||||
{
|
||||
public sealed class DoubleToLog10Converter : IValueConverter
|
||||
{
|
||||
#region IValueConverter Members
|
||||
|
||||
public object Convert(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
var val = Math.Log10((double)value);
|
||||
return double.IsNegativeInfinity(val) ? 0 : val;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
var val = Math.Pow(10, (double)value);
|
||||
return double.IsNegativeInfinity(val) ? 0 : val;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
using System;
|
||||
using Windows.UI.Xaml.Data;
|
||||
|
||||
namespace GraphX.Controls
|
||||
{
|
||||
public sealed class EqualityToBooleanConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
return Equals(value, parameter);
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
if ((bool)value)
|
||||
return parameter;
|
||||
|
||||
//it's false, so don't bind it back
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
/*************************************************************************************
|
||||
|
||||
Extended WPF Toolkit
|
||||
|
||||
Copyright (C) 2007-2013 Xceed Software Inc.
|
||||
|
||||
This program is provided to you under the terms of the Microsoft Public
|
||||
License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license
|
||||
|
||||
For more features, controls, and fast professional support,
|
||||
pick up the Plus Edition at http://xceed.com/wpf_toolkit
|
||||
|
||||
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
|
||||
|
||||
***********************************************************************************/
|
||||
|
||||
using System;
|
||||
using Windows.Foundation;
|
||||
using Windows.UI.Xaml.Data;
|
||||
|
||||
namespace GraphX.Controls
|
||||
{
|
||||
public class RoundedValueConverter : IValueConverter
|
||||
{
|
||||
#region Precision Property
|
||||
|
||||
public int Precision
|
||||
{
|
||||
get
|
||||
{
|
||||
return _precision;
|
||||
}
|
||||
set
|
||||
{
|
||||
_precision = value;
|
||||
}
|
||||
}
|
||||
|
||||
private int _precision = 0;
|
||||
|
||||
#endregion
|
||||
|
||||
public object Convert(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
if( value is double )
|
||||
{
|
||||
return Math.Round( ( double )value, _precision );
|
||||
}
|
||||
else if( value is Point )
|
||||
{
|
||||
return new Point( Math.Round( ( ( Point )value ).X, _precision ), Math.Round( ( ( Point )value ).Y, _precision ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|