Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- System.Windows.Markup.XamlParseException: Set property 'System.Windows.Controls.HeaderedContentControl.Header' threw an exception. ---> System.InvalidOperationException: Specified element is already the logical child of another element. Disconnect it first.
- at System.Windows.FrameworkElement.ChangeLogicalParent(DependencyObject newParent)
- at System.Windows.FrameworkElement.AddLogicalChild(Object child)
- at System.Windows.Controls.HeaderedItemsControl.OnHeaderChanged(Object oldHeader, Object newHeader)
- at System.Windows.Controls.HeaderedItemsControl.OnHeaderChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
- at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
- at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
- at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
- at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
- at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
- at System.Windows.Baml2006.WpfKnownMemberInvoker.SetValue(Object instance, Object value)
- at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(XamlMember member, Object obj, Object value)
- at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)
- --- End of inner exception stack trace ---
- at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlReader templateReader, XamlObjectWriter currentWriter)
- at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlObjectWriter objectWriter)
- at System.Windows.FrameworkTemplate.LoadOptimizedTemplateContent(DependencyObject container, IComponentConnector componentConnector, IStyleConnector styleConnector, List'1 affectedChildren, UncommonField'1 templatedNonFeChildrenField)
- at System.Windows.FrameworkTemplate.LoadContent(DependencyObject container, List'1 affectedChildren)
- at System.Windows.StyleHelper.ApplyTemplateContent(UncommonField'1 dataField, DependencyObject container, FrameworkElementFactory templateRoot, Int32 lastChildIndex, HybridDictionary childIndexFromChildID, FrameworkTemplate frameworkTemplate)
- at System.Windows.FrameworkTemplate.ApplyTemplateContent(UncommonField'1 templateDataField, FrameworkElement container)
- at System.Windows.FrameworkElement.ApplyTemplate()
- at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
- at System.Windows.UIElement.Measure(Size availableSize)
- at System.Windows.Controls.Control.MeasureOverride(Size constraint)
- at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
- at System.Windows.UIElement.Measure(Size availableSize)
- at System.Windows.Controls.VirtualizingStackPanel.MeasureChild(IItemContainerGenerator& generator, IContainItemStorage& itemStorageProvider, IContainItemStorage& parentItemStorageProvider, Object& parentItem, Boolean& hasUniformOrAverageContainerSizeBeenSet, Double& computedUniformOrAverageContainerSize, Double& computedUniformOrAverageContainerPixelSize, Boolean& computedAreContainersUniformlySized, IList& items, Object& item, IList& children, Int32& childIndex, Boolean& visualOrderChanged, Boolean& isHorizontal, Size& childConstraint, Rect& viewport, VirtualizationCacheLength& cacheSize, VirtualizationCacheLengthUnit& cacheUnit, Boolean& foundFirstItemInViewport, Double& firstItemInViewportOffset, Size& stackPixelSize, Size& stackPixelSizeInViewport, Size& stackPixelSizeInCacheBeforeViewport, Size& stackPixelSizeInCacheAfterViewport, Size& stackLogicalSize, Size& stackLogicalSizeInViewport, Size& stackLogicalSizeInCacheBeforeViewport, Size& stackLogicalSizeInCacheAfterViewport, Boolean& mustDisableVirtualization, Boolean isBeforeFirstItem, Boolean isAfterFirstItem, Boolean isAfterLastItem, Boolean skipActualMeasure, Boolean skipGeneration, Boolean& hasBringIntoViewContainerBeenMeasured, Boolean& hasVirtualizingChildren)
- at System.Windows.Controls.VirtualizingStackPanel.MeasureOverrideImpl(Size constraint, Nullable'1& lastPageSafeOffset, List'1& previouslyMeasuredOffsets, Nullable'1& lastPagePixelSize, Boolean remeasure)
- at System.Windows.Controls.VirtualizingStackPanel.MeasureOverride(Size constraint)
- at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
- at System.Windows.UIElement.Measure(Size availableSize)
- at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
- at System.Windows.Controls.ItemsPresenter.MeasureOverride(Size constraint)
- at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
- at System.Windows.UIElement.Measure(Size availableSize)
- at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
- at System.Windows.Controls.ScrollContentPresenter.MeasureOverride(Size constraint)
- at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
- at System.Windows.UIElement.Measure(Size availableSize)
- at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
- at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
- at System.Windows.UIElement.Measure(Size availableSize)
- at System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint)
- at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
- at System.Windows.UIElement.Measure(Size availableSize)
- at System.Windows.Controls.Control.MeasureOverride(Size constraint)
- at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
- at System.Windows.UIElement.Measure(Size availableSize)
- at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
- at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
- at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
- at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
- at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
- at System.Windows.UIElement.Measure(Size availableSize)
- at System.Windows.Controls.Decorator.MeasureOverride(Size constraint)
- at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
- at System.Windows.UIElement.Measure(Size availableSize)
- at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
- at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
- at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
- at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
- at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
- at System.Windows.UIElement.Measure(Size availableSize)
- at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
- at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
- at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
- at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
- at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
- at System.Windows.UIElement.Measure(Size availableSize)
- at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
- at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
- at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
- at System.Windows.UIElement.Measure(Size availableSize)
- at System.Windows.Controls.Border.MeasureOverride(Size constraint)
- at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
- at System.Windows.UIElement.Measure(Size availableSize)
- at System.Windows.Controls.Control.MeasureOverride(Size constraint)
- at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
- at System.Windows.UIElement.Measure(Size availableSize)
- at System.Windows.Controls.Decorator.MeasureOverride(Size constraint)
- at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
- at System.Windows.UIElement.Measure(Size availableSize)
- at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
- at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
- at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
- at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
- at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
- at System.Windows.UIElement.Measure(Size availableSize)
- at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
- at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
- at System.Windows.UIElement.Measure(Size availableSize)
- at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
- at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
- at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
- at System.Windows.UIElement.Measure(Size availableSize)
- at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
- at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
- at System.Windows.UIElement.Measure(Size availableSize)
- at System.Windows.Window.MeasureOverrideHelper(Size constraint)
- at System.Windows.Window.MeasureOverride(Size availableSize)
- at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
- at System.Windows.UIElement.Measure(Size availableSize)
- at System.Windows.ContextLayoutManager.UpdateLayout()
- at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
- at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
- at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
- at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
- at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
- at System.Windows.Media.MediaContext.Resize(ICompositionTarget resizedCompositionTarget)
- at System.Windows.Interop.HwndTarget.OnResize()
- at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)
- at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
- at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
- at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
- at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
- at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
- --Inner Exception:
- System.InvalidOperationException: Specified element is already the logical child of another element. Disconnect it first.
- at System.Windows.FrameworkElement.ChangeLogicalParent(DependencyObject newParent)
- at System.Windows.FrameworkElement.AddLogicalChild(Object child)
- at System.Windows.Controls.HeaderedItemsControl.OnHeaderChanged(Object oldHeader, Object newHeader)
- at System.Windows.Controls.HeaderedItemsControl.OnHeaderChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
- at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
- at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
- at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
- at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
- at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
- at System.Windows.Baml2006.WpfKnownMemberInvoker.SetValue(Object instance, Object value)
- at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(XamlMember member, Object obj, Object value)
- at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)
- <ContextMenu x:Key="QuestionContextMenu">
- <MenuItem Command="{Binding AddChildCommand}"
- CommandParameter="{Binding Model}"
- Header="{StaticResource s_Question_Tooltip_AddChildAnswer}" />
- <MenuItem Command="{Binding RemoveCommand}"
- CommandParameter="{Binding Model}"
- Header="{StaticResource s_Remove}" />
- </ContextMenu>
- <DataTemplate x:Key="dt_Questions"
- DataType="secure:QuestionViewModel">
- <Grid x:Name="MainGrid"
- Width="{Binding ElementName=lvQuestions, Path=ActualWidth}"
- MinHeight="22"
- ContextMenu="{StaticResource QuestionContextMenu}"
- Margin="0 2 0 2">
- ...
- </Grid>
- </DataTemplate>
- <ListBox x:Name="lvQuestions"
- Grid.Row="1"
- Grid.Column="0"
- Grid.ColumnSpan="2"
- Padding="0 2 0 20"
- Panel.ZIndex="{Binding QuestionsZindex}"
- ItemTemplate="{StaticResource dt_Questions}"
- ItemsSource="{Binding QuestionsView, Mode=OneWay}"
- SelectedItem="{Binding SelectedQuestionViewModel, Mode=TwoWay}"
- SelectionMode="Single"
- Style="{StaticResource LeftListBox}"
- VirtualizingStackPanel.IsVirtualizing="True"
- VirtualizingStackPanel.ScrollUnit="Pixel"
- VirtualizingStackPanel.VirtualizationMode="Recycling" />
- <Style TargetType="{x:Type ListBox}">
- <Setter Property="Padding" Value="0" />
- <Setter Property="Background" Value="{x:Null}" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListBox}">
- <ScrollViewer Background="{TemplateBinding Background}">
- <ItemsPresenter Margin="{TemplateBinding Padding}" />
- </ScrollViewer>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style TargetType="ListBoxItem">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ListBoxItem">
- <ContentPresenter />
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
Add Comment
Please, Sign In to add comment