Skip to content

Conversation

@JorisCleVR
Copy link
Contributor

@JorisCleVR JorisCleVR commented Jun 11, 2025

Fixes #3814

Used x:Reference in Button and ProgressBar ControlTemplates to fix some binding errors.

The issue is that ElementName does a Runtime lookup of the element. At some moments in time or on freezable objects this does not work, because they are not available in the visual tree. Therefore within a ControlTemplate x:Reference can be used to do a compile time / load time lookup.

Note that because the lookup is compile time / load time this also has a small performance gain during load of the element.

@corvinsz
Copy link
Member

This indeed fixes the binding failures.
Just for completeness: fixes #3814

@Keboo Keboo added this to the 5.3.0 milestone Jun 13, 2025
@Keboo Keboo merged commit 442f311 into MaterialDesignInXAML:master Jun 13, 2025
2 checks passed
JorisCleVR added a commit to CleVR-bv/MaterialDesignInXamlToolkit that referenced this pull request Jul 18, 2025
JorisCleVR added a commit to CleVR-bv/MaterialDesignInXamlToolkit that referenced this pull request Aug 22, 2025
Keboo pushed a commit that referenced this pull request Aug 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

XAML Binding Failures when ProgressBar is styled with MaterialDesignCircularProgressBar in v5.2.1 (Was working in v5.1.0)

3 participants