I am trying to run the sample code(Logic Circuit example) with Guid as the PortKey.
Eg. <span =“apple-style-span”="" style=“font-family: Consolas; font-size: 13px; line-height: 18px; white-space: pre; : rgb255, 255, 255; “> var<span =“apple-style-span”=”” style=“font-family: Consolas; font-size: 13px; line-height: 18px; white-space: pre; : rgb255, 255, 255; “> model = new<span =“apple-style-span”=”” style=“font-family: Consolas; font-size: 13px; line-height: 18px; white-space: pre; : rgb255, 255, 255; “> GraphLinksModel<span =“apple-style-span”=”” style=“font-family: Consolas; font-size: 13px; line-height: 18px; white-space: pre; : rgb255, 255, 255; “><GateData<span =“apple-style-span”=”” style=“font-family: Consolas; font-size: 13px; line-height: 18px; white-space: pre; : rgb255, 255, 255; “>, String<span =“apple-style-span”=”” style=“font-family: Consolas; font-size: 13px; line-height: 18px; white-space: pre; : rgb255, 255, 255; “>, Guid<span =“apple-style-span”=”” style=“font-family: Consolas; font-size: 13px; line-height: 18px; white-space: pre; : rgb255, 255, 255; “>, WireData<span =“apple-style-span”=”” style=“font-family: Consolas; font-size: 13px; line-height: 18px; white-space: pre; : rgb255, 255, 255; “>>();
It throws an exception “Specific Cast is not valid” while loading the diagram.
Stack Trace:
<font =“apple-style-span”=”” face=“Consolas” size=“3”><span =“apple-style-span”="" style=“line-height: 18px; “> at Northwoods.GoXam.Model.GraphLinksModel`4.#Ym(Object fromdata, Object fromparam, Object todata, Object toparam)
at Northwoods.GoXam.PartManager.#xl(IDiagramModel model, Link link)
at Northwoods.GoXam.PartManager.AddLinkForData(Object linkdata, IDiagramModel model)
at Northwoods.GoXam.PartManager.DoRebuildLinkElements()
at Northwoods.GoXam.PartManager.RebuildLinkElements()
at Northwoods.GoXam.PartManager.RebuildNodeElements()
at Northwoods.GoXam.Diagram.#hc()
at Northwoods.GoXam.Diagram.OnApplyTemplate()
at System.Windows.FrameworkElement.ApplyTemplate()
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
<font =“apple-style-span”=”” face=“Consolas” size=“3”><span =“apple-style-span”="" style=“line-height: 18px; “>
Some findings are that1.The DP PortId in GoXam.Node is of type “String” as shown,public static string GetPortId(DependencyObject d);public static void SetPortId(DependencyObject d, string v);2. Also, i tried to override 2 functions in the LinkType Class i.e. class WireData : GraphLinksModelLinkData<String, Guid>protected override string ConvertPortKeyToString(Guid key){ return key.ToString(); }protected override Guid ConvertStringToPortKey(string s) { return Guid.Parse(s); }But it breaks before the above method is even executed.Can i get some help?Anyone tried using a GraphLinkModel with PortKey other than a String?
<font =“apple-style-span”=”” face=“Consolas” size=“3”><span =“apple-style-span”="" style="line-height: 18px; ">