Hi,
The above exception is thrown when running from VS 2010 using the MVVM pattern to set the visibility of a tile.
Running the published app does not throw any exception at all.
Hope someone can help me.
TIA
Ingo
I'm having exactly this same problem, but I'm not setting DataContext at all (it's inherited).
If I remove the binding on Visiblity it goes away, here's a partial stack:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Element is already the child of another element. 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(T value) at Infragistics.Controls.Lists.XamTileView.OnItemPropertyChanged(Object sender PropertyChangedEventArgs e) at Infragistics.Controls.Lists.TilePaneCollection.Item_PropertyChanged(Object sender PropertyChangedEventArgs e) at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender PropertyChangedEventArgs e) at Infragistics.Controls.Lists.TilePane.OnPropertyChanged(String propertyName) at Infragistics.Controls.Lists.TilePane.OnTilePaneVisibilityChanged(DependencyObject target DependencyPropertyChangedEventArgs e)
Hi Petar,
I appologize for the late response, but I am on Holiday at the moment. Anyway, the suggested answer solves the problem.
Thx,
Hello Ingo,
I am just checking if you got this working or you still require any assistance.
If this is what you were looking for please verify the answer so it helps other customers as well.
Sincerely,Petar MonovDeveloper Support EngineerInfragistics Bulgariawww.infragistics.com/support
Hi Ingo,Try to set DataContext directly on tiles .<ig:TilePane x:Name="Pane1" Header="Pane1" DataContext="{StaticResource Main}" Visibility="{Binding ShowTile, Converter={StaticResource BoolToVisibilityConverter}}" />
Regards,Marin