Quantcast
Channel: Silverlight Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 801

Commented Issue: NullReferenceException [10220]

$
0
0
I get a NullReferenceException when trying to activate ContextMenu. Stack trace:

Microsoft.Phone.Controls.Toolkit.dll!Microsoft.Phone.Controls.ContextMenu.UpdateVisualStates(bool useTransitions) + 0x4f bytes
Microsoft.Phone.Controls.Toolkit.dll!Microsoft.Phone.Controls.ContextMenu.OnOpened(System.Windows.RoutedEventArgs e) + 0x13 bytes
Microsoft.Phone.Controls.Toolkit.dll!Microsoft.Phone.Controls.ContextMenu.OpenPopup.AnonymousMethod__12(object s, System.EventArgs e) + 0xb bytes
System.Windows.dll!MS.Internal.CoreInvokeHandler.InvokeEventHandler(int typeIndex, System.Delegate handlerDelegate, object sender, object args) + 0x1f9 bytes
System.Windows.dll!MS.Internal.JoltHelper.FireEvent(System.IntPtr unmanagedObj, System.IntPtr unmanagedObjArgs, int argsTypeIndex, int actualArgsTypeIndex, string eventName) + 0x178 bytes
[External Code]

The situation that leads to this is that I have a list box that is populated with a databinding from an observable collection. ContextMenu is attached to the stack panel that is inside the data template. Initially I load collection from a database. Everything works fine now. The trouble starts when I add items to the collection. The new item appeara to the display normally, but when I now long press what ever item in the list (old, new) the exception occurs.

Any ideas why?
Comments: ** Comment from web user: wieser_software **

I'm seeing this exact same behavior, in similar circumstances. What was the memory screw-up elsewhere you fixed? Maybe I've coded it the same way.


Viewing all articles
Browse latest Browse all 801

Trending Articles