LibraStack / UnityMvvmToolkit

Brings data-binding to your Unity project
MIT License
469 stars 27 forks source link

Unknown type: 'UnityMvvmToolkit.UITK.BindableListView' #59

Closed Creekmind closed 1 year ago

Creekmind commented 1 year ago

Describe the bug

BindableListView doesn't work in the UI Toolkit.

Minimal reproduction code and steps

  1. Unity 2023.1.14f
  2. UnityMvvmToolkit 1.1.8
  3. I'm using manual for BindableListView - https://github.com/LibraStack/UnityMvvmToolkit/tree/c9b55759c90b16a5f2a1f8eea3bdb887a3df671a#bindablelistview
  4. Create UI document with BindableListView
  5. Start UI builder or application

Current result

UI Builder: image

Plus, there isn't such custom control in UI builder image

Expected result

BindableListView is working

Additional information, screenshots, or code examples

View:

<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements"
  xmlns:uitk="UnityMvvmToolkit.UITK"
  editor-extension-mode="False">

  <Style
    src="project://database/Assets/Art/UI/Character/Inventory.uss" />

  <ui:VisualElement name="Inventory" class="inventory" contentContainer="true">
    <uitk:BindableListView binding-items-source-path="Items" />
  </ui:VisualElement>
</ui:UXML>

Exception in Unity debug console:

Element 'UnityMvvmToolkit.UITK.BindableUIElements.BindableListView' has no registered factory method.
UnityEngine.UIElements.UIDocument:OnValidate () (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/GameObjects/UIDocument.cs:708)
ChebanovDD commented 1 year ago

The BindableListView example has been updated. Thanks.