The following piece of code crashes the Toolkit:
private void GestureListener_Tap(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
{
ContextMenu menu = new ContextMenu();
menu.Items.Add(new MenuItem() { Header = "test" });
menu.IsOpen = true;
}
The crash happens only if a context menu is created and opened in response to a GestureListenet event. The same code outside of a GestureListener event handler works fine.
A complete sample project that illustrates the crash is attached. To trigger a crash, tap anywhere on the main page.
Comments: ** Comment from web user: YuriDiomin **
private void GestureListener_Tap(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
{
ContextMenu menu = new ContextMenu();
menu.Items.Add(new MenuItem() { Header = "test" });
menu.IsOpen = true;
}
The crash happens only if a context menu is created and opened in response to a GestureListenet event. The same code outside of a GestureListener event handler works fine.
A complete sample project that illustrates the crash is attached. To trigger a crash, tap anywhere on the main page.
Comments: ** Comment from web user: YuriDiomin **
Still 100% reproducible for me. I wonder if you did the tap -- the crash happens only when you tap. Let me know if you need further help reproducing it.