зеркало из https://github.com/stride3d/GraphX.git
Use ControlFactory for edge deserialization
The deserialization code was using ControlFactory for vertexes, but not edges. Code is modified to use ControlFactory for edges also.
This commit is contained in:
Родитель
58ead875af
Коммит
545687e90f
|
@ -1515,7 +1515,7 @@ namespace GraphX.WPF.Controls
|
||||||
|
|
||||||
if (datasource == null || datatarget == null)
|
if (datasource == null || datatarget == null)
|
||||||
throw new GX_SerializationException("DeserializeFromFile() -> Serialization logic is broken! Vertex not found. All vertices must be processed before edges!");
|
throw new GX_SerializationException("DeserializeFromFile() -> Serialization logic is broken! Vertex not found. All vertices must be processed before edges!");
|
||||||
var ecc = new EdgeControl { Edge = edgedata, Source = _vertexlist[datasource], Target = _vertexlist[datatarget], DataContext = edgedata};
|
var ecc = ControlFactory.CreateEdgeControl(_vertexlist[datasource], _vertexlist[datatarget], edgedata);
|
||||||
InsertEdge(edgedata, ecc);
|
InsertEdge(edgedata, ecc);
|
||||||
LogicCore.Graph.AddEdge(edgedata);
|
LogicCore.Graph.AddEdge(edgedata);
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче