Skip to content

ConfigurationManager - Mechanism for realtime updating of instances needs work #4397

@tig

Description

@tig

Yep! In the UICatalog case, we somehow lost the call to Apply.

The right place for it is actually in UICatalogApp where we enable CM. I have a fix coming in #4338.

Note there are still cases where Views do not subscribe to CM.Applied, and thus realtime updating of INSTANCES is inconsistent.

What does (or should) work reliably, is the updating of CLASSES, so that new instances get the updated settings.

For example LineCanvas does:

    /// <summary>Creates a new instance.</summary>
    public LineCanvas ()
    {
        // TODO: Refactor ConfigurationManager to not use an event handler for this.
        // Instead, have it call a method on any class appropriately attributed
        // to update the cached values. See Issue #2871
        ConfigurationManager.Applied += ConfigurationManager_Applied;
    }

as does MenuBarv2

    private void OnConfigurationManagerApplied (object? sender, ConfigurationManagerEventArgs e)
    {
        BorderStyle = DefaultBorderStyle;
    }

But Button does not (yet).

The current notification mechanism is fragile and won't scale, so I've resisted using it more broadly.

Originally posted by @tig in #4394

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions