Search Unity

Feature Request ViewData persistence for custom controls

Discussion in 'UI Toolkit' started by MechaWolf99, May 7, 2021.

  1. MechaWolf99

    MechaWolf99

    Joined:
    Aug 22, 2017
    Posts:
    294
    Hello,

    I'm making a custom control (a GridVIew), and want to have the same type of data persist that the ListView does. But right now all of the needed methods are internal, though they were previously public.

    I understand that perhaps you don't want people mixing the View and Model so just made it internal, but it prevents making nice controls that feel like native elements.
    Instead I have to pass around a 'State' class up to the editor window, and then pass it back down to the element and apply it.

    If over usage is the concern, then just make it clear in the docs that it should be used carefully like you do with the UsageHint.

    As it is now, I don't understand the reason for having it internal.
     
    Kichang-Kim likes this.