[GH-ISSUE #91] Error on wake after closing laptop screen #1447

Closed
opened 2026-03-01 18:45:35 +03:00 by kerem · 7 comments
Owner

Originally created by @stellirin on GitHub (Feb 20, 2017).
Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/91

Originally assigned to: @NickeManarin on GitHub.

Unable to cast object of type 'System.String' to type 'System.Windows.DataTemplate'.
at System.Windows.Controls.ItemsControl.OnItemTemplateChanged(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.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)
at System.Windows.ResourceReferenceExpression.InvalidateExpressionValue(Object sender, EventArgs e)
at System.Windows.TreeWalkHelper.InvalidateResourceReferences(DependencyObject d, ResourcesChangeInfo info)
at System.Windows.TreeWalkHelper.OnResourcesChanged(DependencyObject d, ResourcesChangeInfo info, Boolean raiseResourceChangedEvent)
at System.Windows.TreeWalkHelper.OnResourcesChangedCallback(DependencyObject d, ResourcesChangeInfo info, Boolean visitedViaVisualTree)
at System.Windows.DescendentsWalker1._VisitNode(DependencyObject d, Boolean visitedViaVisualTree) at System.Windows.DescendentsWalker1.WalkLogicalChildren(FrameworkElement feParent, FrameworkContentElement fceParent, IEnumerator logicalChildren)
at System.Windows.DescendentsWalker1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren) at System.Windows.DescendentsWalker1.IterateChildren(DependencyObject d)
at System.Windows.DescendentsWalker1._VisitNode(DependencyObject d, Boolean visitedViaVisualTree) at System.Windows.DescendentsWalker1.WalkLogicalChildren(FrameworkElement feParent, FrameworkContentElement fceParent, IEnumerator logicalChildren)
at System.Windows.DescendentsWalker1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren) at System.Windows.DescendentsWalker1.IterateChildren(DependencyObject d)
at System.Windows.DescendentsWalker1._VisitNode(DependencyObject d, Boolean visitedViaVisualTree) at System.Windows.DescendentsWalker1.WalkLogicalChildren(FrameworkElement feParent, FrameworkContentElement fceParent, IEnumerator logicalChildren)
at System.Windows.DescendentsWalker1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren) at System.Windows.DescendentsWalker1.IterateChildren(DependencyObject d)
at System.Windows.DescendentsWalker1._VisitNode(DependencyObject d, Boolean visitedViaVisualTree) at System.Windows.DescendentsWalker1.WalkLogicalChildren(FrameworkElement feParent, FrameworkContentElement fceParent, IEnumerator logicalChildren)
at System.Windows.DescendentsWalker1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren) at System.Windows.DescendentsWalker1.IterateChildren(DependencyObject d)
at System.Windows.DescendentsWalker1._VisitNode(DependencyObject d, Boolean visitedViaVisualTree) at System.Windows.DescendentsWalker1.WalkLogicalChildren(FrameworkElement feParent, FrameworkContentElement fceParent, IEnumerator logicalChildren)
at System.Windows.DescendentsWalker1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren) at System.Windows.DescendentsWalker1.IterateChildren(DependencyObject d)
at System.Windows.DescendentsWalker1._VisitNode(DependencyObject d, Boolean visitedViaVisualTree) at System.Windows.DescendentsWalker1.WalkLogicalChildren(FrameworkElement feParent, FrameworkContentElement fceParent, IEnumerator logicalChildren)
at System.Windows.DescendentsWalker1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren) at System.Windows.DescendentsWalker1.IterateChildren(DependencyObject d)
at System.Windows.DescendentsWalker1._VisitNode(DependencyObject d, Boolean visitedViaVisualTree) at System.Windows.DescendentsWalker1.WalkLogicalChildren(FrameworkElement feParent, FrameworkContentElement fceParent, IEnumerator logicalChildren)
at System.Windows.DescendentsWalker1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren) at System.Windows.DescendentsWalker1.IterateChildren(DependencyObject d)
at System.Windows.DescendentsWalker1._VisitNode(DependencyObject d, Boolean visitedViaVisualTree) at System.Windows.DescendentsWalker1.WalkLogicalChildren(FrameworkElement feParent, FrameworkContentElement fceParent, IEnumerator logicalChildren)
at System.Windows.DescendentsWalker1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren) at System.Windows.DescendentsWalker1.IterateChildren(DependencyObject d)
at System.Windows.DescendentsWalker`1.StartWalk(DependencyObject startNode, Boolean skipStartNode)
at System.Windows.TreeWalkHelper.InvalidateOnResourcesChange(FrameworkElement fe, FrameworkContentElement fce, ResourcesChangeInfo info)
at System.Windows.SystemResources.InvalidateTreeResources(Object args)
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)

PresentationFramework.OnItemTemplateChanged

Originally created by @stellirin on GitHub (Feb 20, 2017). Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/91 Originally assigned to: @NickeManarin on GitHub. **Unable to cast object of type 'System.String' to type 'System.Windows.DataTemplate'.** at System.Windows.Controls.ItemsControl.OnItemTemplateChanged(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.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue) at System.Windows.ResourceReferenceExpression.InvalidateExpressionValue(Object sender, EventArgs e) at System.Windows.TreeWalkHelper.InvalidateResourceReferences(DependencyObject d, ResourcesChangeInfo info) at System.Windows.TreeWalkHelper.OnResourcesChanged(DependencyObject d, ResourcesChangeInfo info, Boolean raiseResourceChangedEvent) at System.Windows.TreeWalkHelper.OnResourcesChangedCallback(DependencyObject d, ResourcesChangeInfo info, Boolean visitedViaVisualTree) at System.Windows.DescendentsWalker`1._VisitNode(DependencyObject d, Boolean visitedViaVisualTree) at System.Windows.DescendentsWalker`1.WalkLogicalChildren(FrameworkElement feParent, FrameworkContentElement fceParent, IEnumerator logicalChildren) at System.Windows.DescendentsWalker`1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren) at System.Windows.DescendentsWalker`1.IterateChildren(DependencyObject d) at System.Windows.DescendentsWalker`1._VisitNode(DependencyObject d, Boolean visitedViaVisualTree) at System.Windows.DescendentsWalker`1.WalkLogicalChildren(FrameworkElement feParent, FrameworkContentElement fceParent, IEnumerator logicalChildren) at System.Windows.DescendentsWalker`1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren) at System.Windows.DescendentsWalker`1.IterateChildren(DependencyObject d) at System.Windows.DescendentsWalker`1._VisitNode(DependencyObject d, Boolean visitedViaVisualTree) at System.Windows.DescendentsWalker`1.WalkLogicalChildren(FrameworkElement feParent, FrameworkContentElement fceParent, IEnumerator logicalChildren) at System.Windows.DescendentsWalker`1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren) at System.Windows.DescendentsWalker`1.IterateChildren(DependencyObject d) at System.Windows.DescendentsWalker`1._VisitNode(DependencyObject d, Boolean visitedViaVisualTree) at System.Windows.DescendentsWalker`1.WalkLogicalChildren(FrameworkElement feParent, FrameworkContentElement fceParent, IEnumerator logicalChildren) at System.Windows.DescendentsWalker`1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren) at System.Windows.DescendentsWalker`1.IterateChildren(DependencyObject d) at System.Windows.DescendentsWalker`1._VisitNode(DependencyObject d, Boolean visitedViaVisualTree) at System.Windows.DescendentsWalker`1.WalkLogicalChildren(FrameworkElement feParent, FrameworkContentElement fceParent, IEnumerator logicalChildren) at System.Windows.DescendentsWalker`1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren) at System.Windows.DescendentsWalker`1.IterateChildren(DependencyObject d) at System.Windows.DescendentsWalker`1._VisitNode(DependencyObject d, Boolean visitedViaVisualTree) at System.Windows.DescendentsWalker`1.WalkLogicalChildren(FrameworkElement feParent, FrameworkContentElement fceParent, IEnumerator logicalChildren) at System.Windows.DescendentsWalker`1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren) at System.Windows.DescendentsWalker`1.IterateChildren(DependencyObject d) at System.Windows.DescendentsWalker`1._VisitNode(DependencyObject d, Boolean visitedViaVisualTree) at System.Windows.DescendentsWalker`1.WalkLogicalChildren(FrameworkElement feParent, FrameworkContentElement fceParent, IEnumerator logicalChildren) at System.Windows.DescendentsWalker`1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren) at System.Windows.DescendentsWalker`1.IterateChildren(DependencyObject d) at System.Windows.DescendentsWalker`1._VisitNode(DependencyObject d, Boolean visitedViaVisualTree) at System.Windows.DescendentsWalker`1.WalkLogicalChildren(FrameworkElement feParent, FrameworkContentElement fceParent, IEnumerator logicalChildren) at System.Windows.DescendentsWalker`1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren) at System.Windows.DescendentsWalker`1.IterateChildren(DependencyObject d) at System.Windows.DescendentsWalker`1.StartWalk(DependencyObject startNode, Boolean skipStartNode) at System.Windows.TreeWalkHelper.InvalidateOnResourcesChange(FrameworkElement fe, FrameworkContentElement fce, ResourcesChangeInfo info) at System.Windows.SystemResources.InvalidateTreeResources(Object args) 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) **PresentationFramework.OnItemTemplateChanged**
kerem 2026-03-01 18:45:35 +03:00
Author
Owner

@NickeManarin commented on GitHub (Feb 20, 2017):

I couldn't find a fix for it yet. :/
It was already in here, btw.

Thanks for the feedback.

<!-- gh-comment-id:281166050 --> @NickeManarin commented on GitHub (Feb 20, 2017): I couldn't find a fix for it yet. :/ [It was already in here, btw.](https://github.com/NickeManarin/ScreenToGif/wiki/Known-Issues) Thanks for the feedback.
Author
Owner

@stellirin commented on GitHub (Feb 20, 2017):

Ah ok, I did a quick scan of the titles of the other open issues, nothing seemed to match.

<!-- gh-comment-id:281191494 --> @stellirin commented on GitHub (Feb 20, 2017): Ah ok, I did a quick scan of the titles of the other open issues, nothing seemed to match.
Author
Owner

@NickeManarin commented on GitHub (Feb 20, 2017):

I'm working on this, but I still don't know what's happening, I can't reproduce this bug anymore. Do you remember what was the state of the application before the sleep? (size of the recording, number of frames, encoding?, etc)

Looks like it is a bug with the list of frames, at the bottom of editor the window. (ItemsControl)

<!-- gh-comment-id:281199352 --> @NickeManarin commented on GitHub (Feb 20, 2017): I'm working on this, but I still don't know what's happening, I can't reproduce this bug anymore. Do you remember what was the state of the application before the sleep? (size of the recording, number of frames, encoding?, etc) Looks like it is a bug with the list of frames, at the bottom of editor the window. (ItemsControl)
Author
Owner

@stellirin commented on GitHub (Feb 25, 2017):

I haven't had this happen recently but I'm using this quite regularly these days to make gifs of bug reports in our software. I'll keep an eye out for future crashes and make a note.

<!-- gh-comment-id:282503915 --> @stellirin commented on GitHub (Feb 25, 2017): I haven't had this happen recently but I'm using this quite regularly these days to make gifs of bug reports in our software. I'll keep an eye out for future crashes and make a note.
Author
Owner

@NickeManarin commented on GitHub (Feb 25, 2017):

Thank you. :)

Oh, I just bumped into this error while viewing a video on full screen. Very strange.

<!-- gh-comment-id:282504163 --> @NickeManarin commented on GitHub (Feb 25, 2017): Thank you. :) Oh, I just bumped into this error while viewing a video on full screen. Very strange.
Author
Owner

@stellirin commented on GitHub (Feb 27, 2017):

Steps to reproduce:

  • Record a gif
  • Play the gif
  • Save the gif
  • Minimize the app
  • Start -> Sleep
  • Wake up -> sign in
  • See error message
<!-- gh-comment-id:282716961 --> @stellirin commented on GitHub (Feb 27, 2017): Steps to reproduce: * Record a gif * Play the gif * Save the gif * Minimize the app * Start -> Sleep * Wake up -> sign in * See error message
Author
Owner

@NickeManarin commented on GitHub (Apr 18, 2017):

Oh, already fixed.

<!-- gh-comment-id:294649341 --> @NickeManarin commented on GitHub (Apr 18, 2017): Oh, already fixed.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ScreenToGif#1447
No description provided.