Note that there are some explanatory texts on larger screens.

plurals
  1. POWrapPanel.Children.Add(): System.ArgumentException: The parameter is incorrect
    text
    copied!<p>I have a WrapPanel in a Windows Phone (7.1) Solution, where I add and delete cyclic user controls. Most time it work but sometimes I get the following error:</p> <pre><code>"The parameter is incorrect. " at MS.Internal.XcpImports.CheckHResult(UInt32 hr) at MS.Internal.XcpImports.Collection_AddValue[T](PresentationFrameworkCollection`1 collection, CValue value) at MS.Internal.XcpImports.Collection_AddDependencyObject[T](PresentationFrameworkCollection`1 collection, DependencyObject value) at System.Windows.PresentationFrameworkCollection`1.AddDependencyObject(DependencyObject value) at System.Windows.Controls.UIElementCollection.AddInternal(UIElement value) at System.Windows.PresentationFrameworkCollection`1.Add(UIElement value) at MyProject.Pages.DashboardPage.RefreshTiles() </code></pre> <p>I don't get this error reproduced, it just pops up sometimes. I noticed, that when I delete the whole WrapPanel and create a new the error never pop up. Thus it's seems to be some problem with deleting and adding items. Here's my code:</p> <pre><code>private void RefreshTiles() { wrapPanelRooms.Children.Clear(); foreach (Room room in Data.Inst.Rooms) { ControlRoomTile newTile = new ControlRoomTile{...}; newTile.MouseLeftButtonUp += (sender, e) =&gt; this.NavigationService.Navigate( new Uri("/Pages/RoomDetailPage.xaml?id=" + ((ControlRoomTile)sender).Id, UriKind.Relative)); try { this.wrapPanelRooms.Children.Add(newTile); } catch (Exception e) { Log.WriteLine(DateTime.Now.ToString("HH:mm:ss.ffff") + " UI: RefreshTiles ERROR1"); } } } </code></pre> <p>Does anyone knowing a fix for that?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload