Guest User

Untitled

a guest
Dec 15th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.88 KB | None | 0 0
  1. 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.
  2. at System.Windows.FrameworkElement.ChangeLogicalParent(DependencyObject newParent)
  3. at System.Windows.FrameworkElement.AddLogicalChild(Object child)
  4. at System.Windows.Controls.HeaderedItemsControl.OnHeaderChanged(Object oldHeader, Object newHeader)
  5. at System.Windows.Controls.HeaderedItemsControl.OnHeaderChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
  6. at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
  7. at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
  8. at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
  9. at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
  10. at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
  11. at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
  12. at System.Windows.Baml2006.WpfKnownMemberInvoker.SetValue(Object instance, Object value)
  13. at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(XamlMember member, Object obj, Object value)
  14. at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)
  15. --- End of inner exception stack trace ---
  16. at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlReader templateReader, XamlObjectWriter currentWriter)
  17. at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlObjectWriter objectWriter)
  18. at System.Windows.FrameworkTemplate.LoadOptimizedTemplateContent(DependencyObject container, IComponentConnector componentConnector, IStyleConnector styleConnector, List'1 affectedChildren, UncommonField'1 templatedNonFeChildrenField)
  19. at System.Windows.FrameworkTemplate.LoadContent(DependencyObject container, List'1 affectedChildren)
  20. at System.Windows.StyleHelper.ApplyTemplateContent(UncommonField'1 dataField, DependencyObject container, FrameworkElementFactory templateRoot, Int32 lastChildIndex, HybridDictionary childIndexFromChildID, FrameworkTemplate frameworkTemplate)
  21. at System.Windows.FrameworkTemplate.ApplyTemplateContent(UncommonField'1 templateDataField, FrameworkElement container)
  22. at System.Windows.FrameworkElement.ApplyTemplate()
  23. at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
  24. at System.Windows.UIElement.Measure(Size availableSize)
  25. at System.Windows.Controls.Control.MeasureOverride(Size constraint)
  26. at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
  27. at System.Windows.UIElement.Measure(Size availableSize)
  28. 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)
  29. at System.Windows.Controls.VirtualizingStackPanel.MeasureOverrideImpl(Size constraint, Nullable'1& lastPageSafeOffset, List'1& previouslyMeasuredOffsets, Nullable'1& lastPagePixelSize, Boolean remeasure)
  30. at System.Windows.Controls.VirtualizingStackPanel.MeasureOverride(Size constraint)
  31. at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
  32. at System.Windows.UIElement.Measure(Size availableSize)
  33. at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
  34. at System.Windows.Controls.ItemsPresenter.MeasureOverride(Size constraint)
  35. at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
  36. at System.Windows.UIElement.Measure(Size availableSize)
  37. at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
  38. at System.Windows.Controls.ScrollContentPresenter.MeasureOverride(Size constraint)
  39. at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
  40. at System.Windows.UIElement.Measure(Size availableSize)
  41. at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
  42. at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
  43. at System.Windows.UIElement.Measure(Size availableSize)
  44. at System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint)
  45. at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
  46. at System.Windows.UIElement.Measure(Size availableSize)
  47. at System.Windows.Controls.Control.MeasureOverride(Size constraint)
  48. at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
  49. at System.Windows.UIElement.Measure(Size availableSize)
  50. at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
  51. at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
  52. at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
  53. at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
  54. at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
  55. at System.Windows.UIElement.Measure(Size availableSize)
  56. at System.Windows.Controls.Decorator.MeasureOverride(Size constraint)
  57. at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
  58. at System.Windows.UIElement.Measure(Size availableSize)
  59. at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
  60. at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
  61. at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
  62. at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
  63. at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
  64. at System.Windows.UIElement.Measure(Size availableSize)
  65. at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
  66. at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
  67. at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
  68. at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
  69. at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
  70. at System.Windows.UIElement.Measure(Size availableSize)
  71. at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
  72. at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
  73. at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
  74. at System.Windows.UIElement.Measure(Size availableSize)
  75. at System.Windows.Controls.Border.MeasureOverride(Size constraint)
  76. at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
  77. at System.Windows.UIElement.Measure(Size availableSize)
  78. at System.Windows.Controls.Control.MeasureOverride(Size constraint)
  79. at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
  80. at System.Windows.UIElement.Measure(Size availableSize)
  81. at System.Windows.Controls.Decorator.MeasureOverride(Size constraint)
  82. at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
  83. at System.Windows.UIElement.Measure(Size availableSize)
  84. at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
  85. at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
  86. at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
  87. at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
  88. at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
  89. at System.Windows.UIElement.Measure(Size availableSize)
  90. at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
  91. at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
  92. at System.Windows.UIElement.Measure(Size availableSize)
  93. at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
  94. at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
  95. at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
  96. at System.Windows.UIElement.Measure(Size availableSize)
  97. at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
  98. at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
  99. at System.Windows.UIElement.Measure(Size availableSize)
  100. at System.Windows.Window.MeasureOverrideHelper(Size constraint)
  101. at System.Windows.Window.MeasureOverride(Size availableSize)
  102. at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
  103. at System.Windows.UIElement.Measure(Size availableSize)
  104. at System.Windows.ContextLayoutManager.UpdateLayout()
  105. at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
  106. at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
  107. at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
  108. at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
  109. at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
  110. at System.Windows.Media.MediaContext.Resize(ICompositionTarget resizedCompositionTarget)
  111. at System.Windows.Interop.HwndTarget.OnResize()
  112. at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)
  113. at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
  114. at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
  115. at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
  116. at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
  117. at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
  118.  
  119. --Inner Exception:
  120. System.InvalidOperationException: Specified element is already the logical child of another element. Disconnect it first.
  121. at System.Windows.FrameworkElement.ChangeLogicalParent(DependencyObject newParent)
  122. at System.Windows.FrameworkElement.AddLogicalChild(Object child)
  123. at System.Windows.Controls.HeaderedItemsControl.OnHeaderChanged(Object oldHeader, Object newHeader)
  124. at System.Windows.Controls.HeaderedItemsControl.OnHeaderChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
  125. at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
  126. at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
  127. at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
  128. at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
  129. at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
  130. at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
  131. at System.Windows.Baml2006.WpfKnownMemberInvoker.SetValue(Object instance, Object value)
  132. at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(XamlMember member, Object obj, Object value)
  133. at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)
  134.  
  135. <ContextMenu x:Key="QuestionContextMenu">
  136. <MenuItem Command="{Binding AddChildCommand}"
  137. CommandParameter="{Binding Model}"
  138. Header="{StaticResource s_Question_Tooltip_AddChildAnswer}" />
  139. <MenuItem Command="{Binding RemoveCommand}"
  140. CommandParameter="{Binding Model}"
  141. Header="{StaticResource s_Remove}" />
  142. </ContextMenu>
  143.  
  144. <DataTemplate x:Key="dt_Questions"
  145. DataType="secure:QuestionViewModel">
  146. <Grid x:Name="MainGrid"
  147. Width="{Binding ElementName=lvQuestions, Path=ActualWidth}"
  148. MinHeight="22"
  149. ContextMenu="{StaticResource QuestionContextMenu}"
  150. Margin="0 2 0 2">
  151. ...
  152. </Grid>
  153. </DataTemplate>
  154.  
  155. <ListBox x:Name="lvQuestions"
  156. Grid.Row="1"
  157. Grid.Column="0"
  158. Grid.ColumnSpan="2"
  159. Padding="0 2 0 20"
  160. Panel.ZIndex="{Binding QuestionsZindex}"
  161. ItemTemplate="{StaticResource dt_Questions}"
  162. ItemsSource="{Binding QuestionsView, Mode=OneWay}"
  163. SelectedItem="{Binding SelectedQuestionViewModel, Mode=TwoWay}"
  164. SelectionMode="Single"
  165. Style="{StaticResource LeftListBox}"
  166. VirtualizingStackPanel.IsVirtualizing="True"
  167. VirtualizingStackPanel.ScrollUnit="Pixel"
  168. VirtualizingStackPanel.VirtualizationMode="Recycling" />
  169.  
  170. <Style TargetType="{x:Type ListBox}">
  171. <Setter Property="Padding" Value="0" />
  172. <Setter Property="Background" Value="{x:Null}" />
  173. <Setter Property="Template">
  174. <Setter.Value>
  175. <ControlTemplate TargetType="{x:Type ListBox}">
  176. <ScrollViewer Background="{TemplateBinding Background}">
  177. <ItemsPresenter Margin="{TemplateBinding Padding}" />
  178. </ScrollViewer>
  179. </ControlTemplate>
  180. </Setter.Value>
  181. </Setter>
  182. </Style>
  183.  
  184. <Style TargetType="ListBoxItem">
  185. <Setter Property="Template">
  186. <Setter.Value>
  187. <ControlTemplate TargetType="ListBoxItem">
  188. <ContentPresenter />
  189. </ControlTemplate>
  190. </Setter.Value>
  191. </Setter>
  192. </Style>
Add Comment
Please, Sign In to add comment