Giter Site home page Giter Site logo

Comments (5)

abeckus avatar abeckus commented on June 2, 2024

Yes there is:
Please see the following class in CircuitEditor example for reference.
public class ModuleProperties : CustomTypeDescriptorNodeAdapter, IDynamicTypeDescriptor
Basically you need to subclass CustomTypeDescriptorNodeAdapter and override projected method GetPropertyDescriptors().
you can inspect the object and create list of descriptors using any conditions you like.

Alan

from atf.

nrvllrgrs avatar nrvllrgrs commented on June 2, 2024

That works perfectly for attributes on the selected DomNode. Any suggestions for if the DomNode is in an EmbeddedCollectionEditor?

from atf.

abeckus avatar abeckus commented on June 2, 2024

It should work fine for child DomNodes too as long as you register CustomTypeDescriptorNodeAdapter for each DomNodeTypes that have dynamic properties.
If this is not case then there is a bug, please let me know so I can fix it in next update.

Alan

from atf.

nrvllrgrs avatar nrvllrgrs commented on June 2, 2024

I have a CustomTypeDescriptorNodeAdapter for the child DomNode, which it is registered to in SchemaLoader using
Schema.childNodeName.Type.Define(new ExtensionInfo<DynamicChildNodeProperties>())
Updating the child DomNode's properties in an embedded collection does not update its dynamic properties.

from atf.

abeckus avatar abeckus commented on June 2, 2024

Here is a quick suggestion until I can address this issue with next Update.
I haven't setup a use case to reproduce this bug yet.
But tracing the code path it seems the problem is the property descriptors is cached for optimization purpose..
Try to comment out the code that caches the property descriptors and let me know if it is the case.

change GetPropertyDescriptors() method in class PropertyEditingContext
located at ..\Framework\Atf.Gui\Controls\PropertyEditing

// comment out caching
public static PropertyDescriptor[] GetPropertyDescriptors(PropertyEditingContext context)
{
if (context == null || context.m_selection.Length == 0)
return new PropertyDescriptor[0];

        // don't use cach
        //if (context.m_propertyDescriptors != null)
        //    return context.m_propertyDescriptors;

        PropertyDescriptor[] result = context.CreatePropertyDescriptors();

       // don't cache the result.
       // context.m_propertyDescriptors = result;
        return result;
    }

Also comment out
//private PropertyDescriptor[] m_propertyDescriptors;
to avoid compiler warning as error.

Alan

from atf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.