View Issue Details

IDProjectCategoryView StatusLast Update
0004151NoesisGUIStudiopublic2026-04-07 17:24
Reporterdstewart Assigned Tosfernandez  
PrioritynormalSeverityminor 
Status closedResolutionno change required 
Product VersionStudio_Beta 
Target VersionStudio_Beta 
Summary0004151: Phantom Bindings Occur When Default Template Elements Removed from Template
Description

Currently, when creating a Template, certain Elements within will be pre-bound.
For example, a Button will contain a ContentPresenter that is able to take a Foreground (colour) value.

If the ContentPresenter is removed altogether, and new Elements are introduced to the Template, some Properties of the newly-introduced Elements will find themselves bound, despite having no Bindings active in their Properties.

In this case, replacing a ContentPresenter with a completely fresh TextBlock will result in the TextBlock being coloured by the Button Template's "Foreground" property, despite the TextBlock's 'Foreground' containing no Bindings to the TemplatedParent.

Video attached.


Repro Steps:

1) Create a Project with a MainPage.xaml
2) Introduce a Button to the Stage, and set any Foreground colour to it.
3) Right-Click on the Button, and navigate to 'Templates', 'Button', and then 'Create'.
This will open the Template in the Template Dummy Editor.
4) Select the ContentPresenter, and delete it from within the Template.

5) Introduce a TextBlock into the Template.
Observe how despite being a fresh Element, the TextBlock comes pre-coloured with the colour picked in Step 2).
Observe how the introduced TextBlock has no Bindings on its 'Foreground' Property.

6) From within the Template, MiddleMouseClick over the TextBlock's 'Foreground' Property.
Observe how no changes are observed, and that the colour selected in Step 2) now serves as the Element's 'Default' Value.

7) Right-Click on the Template's default Border element, and from its Context Menu navigate to 'Layout', 'Replace With', then 'Grid'.
8) Add another TextBlock adjacent to the TextBlock introduced in Step 5), side-by-side within the Grid created in Step 7).
Observe how this second TextBlock is also inheriting the Parent Element's 'Foreground' value despite also being fresh/unbound.

Expected Results: Only Elements containing deliberate Bindings reflect the values of another Property.
Expected Results: Introducing a fresh Element into a Template should work exactly as introducing an Element to a Page, in that its visuals reflect the Element's defaults, and is not changed from the Template's values until the Bindings are created.

Attached Files
PlatformAny

Activities

sfernandez

sfernandez

2025-05-12 16:59

manager   ~0010621

This has nothing to do with bindings, but another feature of the dependency properties: inheritance.

Some properties are defined to inherit through the UI tree (like DataContext, FlowDirection, Foreground, FontSize, FontWeight, FontStyle, FontStretch...) so you don't need to set them everywhere. For example you can set the Foreground in a ListBox and all the items will inherit that foreground without you having to set it in each item.

dstewart

dstewart

2025-05-12 17:26

developer   ~0010624

Ah okay, understood!
Good with moving this away from being a Bug and instead being a Feedback item. To me, this definitely feels like an exception rather than a feature because it doesn't do the same conserving the 'Background', 'Border', or the 'Text/Content'. However, I can see that the Text Properties do indeed all work as you described. Maybe there is a future discussion on how to make this mechanic visible to the end-user, because there isn't really a way to know which Properties are inheritances, and which aren't.

Thanks Sergio!

dstewart

dstewart

2026-04-07 17:24

developer   ~0012163

Closing as agreed during meeting, not a bug! Will create new tickets for visibility of 'where the value comes from'.

Issue History

Date Modified Username Field Change
2025-05-12 16:18 dstewart New Issue
2025-05-12 16:18 dstewart File Added: 2025-05-12 09-56-17_Compressed.mp4
2025-05-12 16:24 dstewart Description Updated
2025-05-12 16:59 sfernandez Assigned To => sfernandez
2025-05-12 16:59 sfernandez Status new => feedback
2025-05-12 16:59 sfernandez Note Added: 0010621
2025-05-12 17:26 dstewart Note Added: 0010624
2025-05-12 17:26 dstewart Status feedback => assigned
2025-05-13 11:42 jsantos Target Version => Studio_Beta
2026-04-07 17:24 dstewart Status assigned => closed
2026-04-07 17:24 dstewart Resolution open => no change required
2026-04-07 17:24 dstewart Note Added: 0012163