Experiencing COM Exception

Hi,

We are using Goxam,
But we are experiencing COM Exception.
while assigning model to Diagram
//
this.rcDiagram.Model = model;
//
Please have a look at the stack Trace




StackTrace " at MS.Internal.XcpImports.CheckHResult(UInt32 hr)\r\n at MS.Internal.XcpImports.UIElement_Measure(UIElement element, Size availableSize)\r\n at System.Windows.UIElement.Measure(Size availableSize)\r\n at Northwoods.GoXam.Part.#Vy()\r\n at Northwoods.GoXam.PartManager.AddNodeForData(Object nodedata, IDiagramModel model)\r\n at Northwoods.GoXam.PartManager.DoRebuildNodeElements()\r\n at Northwoods.GoXam.PartManager.RebuildNodeElements()\r\n at Northwoods.GoXam.Diagram.#hc()\r\n at Northwoods.GoXam.Diagram.OnModelChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\r\n at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)\r\n at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)\r\n at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet)\r\n at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)\r\n at Northwoods.GoXam.Diagram.set_Model(IDiagramModel value)\r\n at iCore.UI.RuleConfigurator.UCRuleCanvas.OnCategorySelected(Object parm)" string


Message “Error HRESULT E_FAIL has been returned from a call to a COM component.” string


//The actual code

FrameworkElement framework = this as FrameworkElement;
DataTemplateDictionary dtd = Diagram.FindResource(framework, “NodeTemplateDictionary”);
dtd.Add(RuleNodeConstantDataTemplate.EmptyNodeDataTemplate, Diagram.FindResource(framework, RuleNodeConstantDataTemplate.EmptyNodeDataTemplate));
dtd.Add(RuleNodeConstantDataTemplate.SourceNodeDataTemplate, Diagram.FindResource(framework, RuleNodeConstantDataTemplate.SourceNodeDataTemplate));
dtd.Add(RuleNodeConstantDataTemplate.ItemNodeDataTemplate, Diagram.FindResource(framework, RuleNodeConstantDataTemplate.ItemNodeDataTemplate));
dtd.Add(RuleNodeConstantDataTemplate.CompletionNodeDataTemplate, Diagram.FindResource(framework, RuleNodeConstantDataTemplate.CompletionNodeDataTemplate));
dtd.Add(RuleNodeConstantDataTemplate.ExpandedNodeDataTemplate, Diagram.FindResource(framework, RuleNodeConstantDataTemplate.ExpandedNodeDataTemplate));
var model = new GraphLinksModel<RuleNodeData, String, String, RuleLinkData>();
String xml = this.LoadText(“DominoRuleGrammer”, “xml”);
model.Load<RuleNodeData, RuleLinkData>(XElement.Parse(xml), “ND”, “LD”);
model.Modifiable = true;
model.HasUndoManager = true;
//return model;
//object tempModel = rulesService.LoadNodeTemplates(this) as IDiagramModel;
//Exception occurs here
this.rcDiagram.Model = model;

Basically there’s a bug in the DataTemplate that you are using for the nodes. Unfortunately Silverlight isn’t very good at error messages.

Typically when I encounter such problems I try to narrow it down by simplifying the template until it works.

You can also try using the template outside of the GoXam Diagram.