MaterialDesignInXAML / MaterialDesignInXAML/MaterialDesignInXamlToolkit

Seemingly random binding errors for PopupBox

Open
#1,493 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
16.3k
Forks
3.5k
Avg merge
1d 22h
Merged PRs (30d)
8

Description

I seem to get this error at random times during the execution of my application:

> System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='MaterialDesignThemes.Wpf.PopupBox', AncestorLevel='1''. BindingExpression:Path=Foreground; DataItem=null; target element is 'PackIcon' (Name=''); target property is 'Foreground' (type 'Brush')

It's not completely "random" as it seems to coincides with clicking on some UI element. The funny thing is, the element that is clicked on is typically NOT a PopupBox. Is anyone else seeing this? Is there perhaps an error in my code somewhere that I could trace this to and not a bug?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported binding error while clicking the UI elements described, then inspect the PopupBox and PackIcon binding relationship named in the message. Done means determining whether the error originates in the toolkit or the application and documenting a reproducible cause or fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.