2
Vote

Windows Phone - "Windows.UI.Xaml.Controls.Frame.NavigationFailed was unhandled"

description

Hi,

Navigating from my HubPage to the ItemPage gives me this Exception:
-       e   {Windows.UI.Xaml.UnhandledExceptionEventArgs}   Windows.UI.Xaml.UnhandledExceptionEventArgs
-       Exception   {System.ArgumentNullException: Value cannot be null.
Parameter name: key
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Collections.Generic.Dictionary`2.set_Item(TKey key, TValue value)
   at Microsoft.Practices.Prism.StoreApps.VisualStateAwarePage.OnNavigatedFrom(NavigationEventArgs e)}  System.Exception {System.ArgumentNullException}
+       [System.ArgumentNullException]  {System.ArgumentNullException: Value cannot be null.
Parameter name: key
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Collections.Generic.Dictionary`2.set_Item(TKey key, TValue value)
   at Microsoft.Practices.Prism.StoreApps.VisualStateAwarePage.OnNavigatedFrom(NavigationEventArgs e)}  System.ArgumentNullException
+       Data    {System.Collections.ListDictionaryInternal} System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
        HelpLink    null    string
        HResult -2147467261 int
+       InnerException  null    System.Exception
        Message "Value cannot be null.\r\nParameter name: key"  string
        Source  "mscorlib"  string
        StackTrace  "   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)\r\n   at System.Collections.Generic.Dictionary`2.set_Item(TKey key, TValue value)\r\n   at Microsoft.Practices.Prism.StoreApps.VisualStateAwarePage.OnNavigatedFrom(NavigationEventArgs e)"  string
+       Static members      
+       Non-Public members      
        Handled false   bool
        Message "Windows.UI.Xaml.Controls.Frame.NavigationFailed was unhandled."    string
I don't have a OnNavigatedFrom event define in my HubPage.xaml.cs nor my viewmodel when I navigate to the ItemPage on a selected item.

comments

VcDeveloper wrote Oct 10, 2014 at 11:25 PM

Here is the handled Exception when I added:
protected async override void OnNavigatedFrom(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
A first chance exception of type 'System.ArgumentNullException' occurred in mscorlib.ni.dll
Message:Value cannot be null.
Parameter name: key
InnerException:
Source:mscorlib
StackTrace:   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Collections.Generic.Dictionary`2.set_Item(TKey key, TValue value)
   at Microsoft.Practices.Prism.StoreApps.VisualStateAwarePage.OnNavigatedFrom(NavigationEventArgs e)
   at NathsarTS.Views.HubPage.<>n__FabricatedMethodf(NavigationEventArgs )
   at NathsarTS.Views.HubPage.<OnNavigatedFrom>d__c.MoveNext()
HelpLink:   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Collections.Generic.Dictionary`2.set_Item(TKey key, TValue value)
   at Microsoft.Practices.Prism.StoreApps.VisualStateAwarePage.OnNavigatedFrom(NavigationEventArgs e)
   at NathsarTS.Views.HubPage.<>n__FabricatedMethodf(NavigationEventArgs )
   at NathsarTS.Views.HubPage.<OnNavigatedFrom>d__c.MoveNext()