Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3996806
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:19:27+00:00 2026-05-20T07:19:27+00:00

I have a weird issue, when I navigate back to the page first viewed

  • 0

I have a weird issue, when I navigate back to the page first viewed in my windows phone 7 application i get an exception

“{System.ArgumentException: The parameter is incorrect. }”

I cannot seem to find the source of the error – has anyone else experienced this?

Callstack is:

   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at System.ThrowHelper.ThrowArgumentOutOfRangeException()
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at System.Collections.Generic.List`1.System.Collections.IList.get_Item(Int32 index)
   at System.Windows.Controls.ItemCollection.GetItemImpl(Int32 index)
   at System.Windows.Controls.ItemCollection.GetItemImplSkipMethodPack(Int32 index)
   at System.Windows.PresentationFrameworkCollection`1.get_Item(Int32 index)
   at System.Windows.Controls.VirtualizingStackPanel.CleanupContainers(ItemsControl itemsControl)
   at System.Windows.Controls.VirtualizingStackPanel.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
   at MS.Internal.XcpImports.MeasureOverrideNative(IntPtr element, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
   at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize)
   at System.Windows.FrameworkElement.MeasureOverride(Size availableSize)
   at System.Windows.Controls.ScrollContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
   at MS.Internal.XcpImports.MeasureNative(IntPtr element, Single inWidth, Single inHeight)
   at MS.Internal.XcpImports.UIElement_Measure(UIElement element, Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
   at MS.Internal.XcpImports.MeasureOverrideNative(IntPtr element, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
   at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize)
   at System.Windows.FrameworkElement.MeasureOverride(Size availableSize)
   at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
   at MS.Internal.XcpImports.MeasureOverrideNative(IntPtr element, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
   at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize)
   at System.Windows.FrameworkElement.MeasureOverride(Size availableSize)
   at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
   at MS.Internal.XcpImports.MeasureOverrideNative(IntPtr element, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
   at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize)
   at System.Windows.FrameworkElement.MeasureOverride(Size availableSize)
   at Microsoft.Phone.Controls.PhoneApplicationFrame.MeasureOverride(Size availableSize)
   at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)

Interestingly enough someone else has the same error:

.NET: ArgumentOutOfRangeException when calling .Add on a collection (Trouble with Pivot control)

but my error is not related to a watchable list, as my list is not inherriting from the observable list types…

the XAML for the page being navigated to is really simple as well:

<phone:PhoneApplicationPage 
    x:Class="TestApp.PhoneApplication.AddItem"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="TestApplication" Style="{StaticResource PhoneTextNormalStyle}"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <TextBox Height="72" HorizontalAlignment="Left" Margin="0,324,0,0" Name="txtItemName" Text="Item name" VerticalAlignment="Top" Width="450" GotFocus="txtItemName_GotFocus" LostFocus="txtItemName_LostFocus" />
            <Button Content="Save" Height="72" HorizontalAlignment="Left" Margin="0,402,0,0" Name="btnSave" VerticalAlignment="Top" Width="160" Click="btnSave_Click" />
            <Button Content="Cancel" Height="72" HorizontalAlignment="Left" Margin="290,402,0,0" Name="btnCancel" VerticalAlignment="Top" Width="160" Click="btnCancel_Click" />
        </Grid>
        <ProgressBar Height="4" Style="{StaticResource PerformanceProgressBar}"  HorizontalAlignment="Left" Margin="12,480,0,0" Name="progressBar1" VerticalAlignment="Top" Width="460" Grid.Row="1" Opacity="0" Background="#FFCF2B26" Foreground="#FFCF2B26" />
    </Grid>
</phone:PhoneApplicationPage>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T07:19:28+00:00Added an answer on May 20, 2026 at 7:19 am

    I found the solution to this.

    a users navigation was:

    • load application and go to main.xaml (if no items go to additem.xaml in onnavigating)
    • enter item
    • go forward to main.xaml
    • go to detail view and delete item
    • navigate back to main.xaml where if there are not items i goback AGAIN

    the problem was i think a bug in the framework. my list of items in main.xaml was not an observable collection. this means that after going back to the main.xaml it must have been trying to load the context from the previous view – which had now changed and there were no items in the list, so it crashed.

    It looked like it was happening on the 2 NavigationContext.GoBack() because it was firing on a different thread and only appearing AFTER the navigation had started to occur – weird.

    i resolved this issue by making the collection that was on display in list form on main.xaml observable and making the items inside adhere to INotifyChanged. Once i did this everything magically started working…

    thanks to everyone who tried to help – your input was really appreciated (my upvotes show this gratitude)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a weird issue. Say you have the following: Application.ThreadException += something; try
I seem to have a weird issue with the System.Diagnostics.Process.Start method. I have a
Having a weird issue. I'm new to Macs and have a windows VM that
i have a weird issue with a UIScrollView and a UIWebView in it. First
I have a weird issue. I can get Event.COMPLETE to fire when I set
I have a weird issue that only seems to be affecting IE 7. The
I have a weird issue. Here is the setup: I have a NSOperationQueue which
I have a weird issue with printing data out. I use printf to print
I am creating a store in Magento and have a weird issue with IE6
We have a semi-weird issue for our site. Consistently, from 1 anonymous* user the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.