Hello,
I have personally had this issue as well when using the SwitchToDialog function, sadly I am not able to look at your code but I can tell you what I did to fix it.
At first I switched to a new dialog like so:
var Core::Group homeDialog = new Application::HomeScreen;
//Dismiss current screen, switch to "home screen"
SwitchToDialog(homeDialog , null, null, null, null, null, null, null, null, null, false);
However, I found that switching dialogs made my device hardfault or "freeze" after a few times. I suppose it has to do with the fact that I'm constantly creating a completely new dialog in memory, but switching dialogs does not actually seem to "delete" the old dialog that is dismissed when calling SwitchToDialog. Hence why switching back a few times between dialogs seems to eat your device's memory; especially with more intensive dialogs.
The fix here is to *only* create a new dialog if it does not already exist within the application. My implementation of that is like so:
var Core::Group homeDialog = rootthis.FindDialogByClass(Application::HomeScreen);
if (homeDialog == null)
{
homeDialog = new Application::HomeScreen;
}
Owner.SwitchToDialog(homeDialog , null, null, null, null, null, null, null, null, null, false);
Hope it helps!