View Issue Details

IDProjectCategoryView StatusLast Update
0003364NoesisGUIStudiopublic2025-10-29 11:39
Reporterdstewart Assigned Tosfernandez  
PrioritynormalSeverityminor 
Status resolvedResolutionno change required 
Product VersionStudio_Alpha 
Target VersionStudio_Beta 
Summary0003364: ItemContainer Templates Have the Incorrect Visual States Assigned to Them
Description

When looking to customise an ItemContainer Template to support custom Visual States presentation, the Visual States that exist by default are not the correct ones for the element in question, and cannot be edited to reflect the functionality supported by ItemContainers.

Steps To Reproduce

Repro Steps:

1) Create a Page
2) Create some random Data in the Data/Data Structure section of the Data Panel, as follows:

...STRUCTURE 1 (Individual Content):
...Parent: Name= "MyData", Type="Class", Extends: "DynamicObject"
...Child: Name="ItemName", Type= "String", MinWordCount="1", MaxWordCount="10"

...STRUCTURE 2 (Collection of Individuals):
...Parent: Name="MyCollection", Type="Class", Extends: "DynamicObject"
...Child: Name="ItemCollection", Type="Collection", ItemType= "MyData", MinItemCount="1", MaxItemCount="10"

3) Under the "Data Sets" Data panel, find "MyCollection", and add it, and then Generate Sample Data, then Assign it to the Page. This should be called "My Data Set 001" by default.
4) Add a ListBox to the Page.
5) Right-Click on the ListBox, and navigate to Template->Item->Create. This will place you in the scope of the Template, as visible by the magenta screen border.
6) Set the Binding of the Text Property of the default TextBlock to "ItemName" created in Step 2. This should make the placeholder data text appear in the listbox succesfully.
7) Exit the inside of the ListBox Item template and return to the page where the ListBox appears.

8) In the Resources Panel, create a ControlTemplate, and name it "MyItemContainerTemplate"
9) In the Resources Panel, edit MyItemContainerTemplate by clicking on the pencil icon that appears when hovering over its name in the Resources panel.
10) Change the background Solid Color Brush to any nice and visible color (a bright red works well), and set the opacity of the colour to 50%
11) Add a Content Presenter under the root grid of the ItemContainer Template.
12) Exit the Template, and return to the Page.

13) Right-Click on the ListBox, and navigate to Styles->ItemContainer->Create
14) Under the Properties Panel under the 'Templating' section, select "MyItemContainerTemplate"

Observe how the ListBox contents now reflect the custom ItemContainer Styling.

15) In the Resources Panel, edit MyItemContainerTemplate by clicking on the pencil icon that appears when hovering over its name in the Resources panel.
16) Navigate to the Animation Panel.

Observe how the Visual States correspond to the Visual States of a Button, and not that of an ItemContainer.
The Visual States of an ItemContainer should be:
CommonStates
-Normal
-Disabled
-MouseOver

SelectionStates
-SelectedUnfocused
-Selected
-Unselected

FocusStates
-Focused
-Unfocused

PlatformAny

Activities

sfernandez

sfernandez

2024-06-05 17:03

manager   ~0009658

Last edited: 2024-06-06 02:02

When the ControlTemplate is created, did you assign the TargetType of the template?
If no TargetType is assigned it will default to a basic Control.

If you select ListBoxItem in the TargetType list and edit the template VisualStates, they will show the SelectionStates as expected.

dstewart

dstewart

2025-10-29 11:39

developer   ~0011282

Sergio's suggestion was the solution. Issues occured due to not selecting a TargetType for the Template. Closing!

Issue History

Date Modified Username Field Change
2024-06-05 15:37 dstewart New Issue
2024-06-05 17:03 sfernandez Assigned To => sfernandez
2024-06-05 17:03 sfernandez Status new => feedback
2024-06-05 17:03 sfernandez Note Added: 0009658
2024-06-06 02:01 jsantos Target Version => Studio_Alpha
2024-06-06 02:02 jsantos Note Edited: 0009658
2025-04-02 11:09 sfernandez Target Version Studio_Alpha => Studio_Beta
2025-10-29 11:39 dstewart Status feedback => resolved
2025-10-29 11:39 dstewart Resolution open => no change required
2025-10-29 11:39 dstewart Note Added: 0011282