Skip to content

Fix uxml template childs binding issue. #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,23 @@ private static void GetBindableElements(VisualElement visualElement, ICollection
return;
}

var itemChildCount = visualElement.childCount;
if (visualElement is TemplateContainer)
{
var hierarchyChildCount = visualElement.hierarchy.childCount;

for (var i = 0; i < itemChildCount; i++)
for (var i = 0; i < hierarchyChildCount; i++)
{
GetBindableElements(visualElement.hierarchy[i], elements);
}
}
else
{
GetBindableElements(visualElement[i], elements);
var childCount = visualElement.childCount;

for (var i = 0; i < childCount; i++)
{
GetBindableElements(visualElement[i], elements);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "com.chebanovdd.unitymvvmtoolkit",
"displayName": "Unity MVVM Toolkit",
"author": { "name": "ChebanovDD", "url": "https://github.com/ChebanovDD" },
"version": "1.1.0",
"version": "1.1.1",
"unity": "2018.4",
"description": "The Unity Mvvm Toolkit allows you to use data binding to establish a connection between the app UI and the data it displays. This is a simple and consistent way to achieve clean separation of business logic from UI.",
"keywords": [ "mvvm", "binding", "ui", "toolkit" ],
Expand Down