Several changes are made to DragBehavior, mainly to reduce conflicts between VertexControl and DragBehavior trying to handle the same events and conflicting with each other. For example, prior to these changes, the VertexControl was not getting the MouseUp events it was expecting.
VertexControl MouseDoubleClick handler no longer marks the event handled because it prevents parent controls from receiving the bubbling event. Marking the other mouse events handled might be undesirable as well because notifying the RootArea of the events doesn't necessarily mean other elements of the visual tree shouldn't get a chance at the event. The corresponding RootArea events are fine, but they are different events and bypass the rest of the bubbling that the events on the VertexControl would continue through. In my opinion, the event handlers of the VertexControl should not mark the events handled, but I have only changed that for MouseDoubleClick at this time.
There were several places in the code where the Visibility property was
being set as a local value. That interferes with the use of styles to
control visibility. I modified each place where Visibility was set as a
local value to use SetCurrentValue instead.
In the case of VertexControl, a bit more was needed. The sequence of
events to hide and show VertexControl during the layout process was
still calling SetCurrentValue after my style triggers. So, I created the
GraphAreaBase.PositioningComplete attached property and manipulate that
instead. When the layout is in progress and the controls should be
hidden, the attached property is set false and a VertexControl style
trigger can set the property to Hidden. When the layout is complete and
the controls are positioned, the property is set to true and the style
trigger is no longer in effect. Then my style triggers can take over and
properly control the visibility.
The VertexControl class uses
DependencyPropertyDescriptor.AddValueChanged to receive change
notifications on GraphAreaBase.X and GraphAreaBase.Y attached
properties. It was not removing the value change monitoring and had a
memory leak as a result. Modified the control position change handling
to use bindings instead of DependencyPropertyDescriptor.AddValueChanged.
This eliminates strong references from the property descriptor to the
vertex controls.
Added support for reversing the geometry. This is required for animating shapes along a path where the direction needs to be reversed without using the Storyboard.AutoReverse property.
+ Fixed bindings to DefaultEdgePointer::Visibility property
+ Implemented edge cut logic for EdgePointer placed at edge 'source' to gain better visual quality like its 'target' counterpart
+ Fixed ZoomControl zoom sometimes not firing from code call after control is loaded [WPF]
+ Fixed VB sample project dependencies and refactored code a bit
+ GraphArea::PreloadVertexes() now accepts graph param as optional
+ Added GraphArea::PreloadGraph() method
The GraphArea AutoresolveIds method was clearing _dataIdsCollection and
resetting _dataIdCounter between vertex and edge processing. This often
resulted in GetNextUniqueId returning IDs that were already in use.
Additionally, if the graph was populated by deserialization,
_dataIdsCollection was not populated with the IDs pulled in during
deserialization. So, the next generated ID could be a duplicate. Calling
AutoresolveIds() takes care of that.
Refactored file handling, removing IFileServiceProvider and changing
GraphArea so that it simply provides the data for serialization and
accepts data for deserialization. This makes it easier to handle
serialization with other storage types. (Still need mods for METRO)
+ Added selective vertex and edge support for following algorithms: Circular [ALL]
+ Fixed layout algorithm calculations to always receive actual vertex positions as input parameter
This will fix selective VaE support for default algorithms. [WPF, METRO]
* Asynchronous layout is now executed in a Task rather than a BackgroundWorker (Tasks go hand in hand with CancellationToken)
* UI synchronization is now done through the task scheduler of the dispatcher object, which means that any exception that may occur on the UI/dispatcher thread is marshaled back to the task starter, and will not automatically terminate the process with an unhandled exception
+ Made EdgeControl::LabelVerticalOffset property dependecy [WPF, METRO]
+ Updated default control templstes to include some new properties setup by default [WPF, METRO]
1. EdgePointerImage class with name "PART_EdgePointerImageForSource" - marks edge source pointer (new!)
2. EdgePointerImage class with name "PART_EdgePointerImageForTarget" - marks edge target pointer
Look in GeneralTemplate.xaml of ShowcaseApp.WPF project.
+ Fixed annoying data binding error in ZoomControl slider binding [METRO, WPF]
+ Fixed ZoomControl unresponsivness after startup (prev needed to change zoom/translation first to work fine) [WPF,METRO]
!Breaking changes
+ Renamed and changed to Enum - ZoomControl::UseAbsoluteZoomOnMouseWheel to MouseWheelZoomingMode [METRO, WPF]
+ Added new ShowcaseApp.WPF with mostly the same functionality as before but in a new nutshell and with refactored code. Expect new showcases soon.
+ Added some new exceptions for GraphArea on invalid or insufficient data [WPF,METRO]
+ Addded automatic default params generation for GXLogicCore if default algorithm was changed and default params property is null
+ Fixed async calc not being aborted on invalid data (can cause crash) [WPF,METRO]
+ Implemented VertexControl::ShowLabel property as dependecy for templating purpose [WPF]
+ Fixed vertex label display [WPF]
+ Implemented IOverlapRemovalParameters properties setters to be able to change params easily[ALL]
+ Made EdgeBase::RoutingPoints property virtual in case you want to override it and add custom serialization attributes (as was the issue with YAXLib)[ALL]
!Breaking changes
+ Renamed VertexControl::MathShape property to VertexShape for template bindings to work [WPF, METRO]
+ Removed YAXLib project from solution and its dependencies from GraphX projects except showcase project. This will make GraphX independent from this 3rd party lib. [WPF]
The cost is that there is no built in FileServiceProvider anymore but you can easily create your own using provided interface or use YAXLib example from showcase app.
One less additional dll file :)
+ Added selective vertex and edge support for calculations. Use SkipProcessing property on vertex or edge data object to include/exclude in calculations and visualization.
Works only in WPF version.
+ Changed CopyToBidirectionalGraph() extension method
+ Fixed rectangular selection logic
+ Some code refactoring