Exemple #1
0
    private UIComponentNode AddDefinition(IUIComponentDefinition definition)
    {
        var node = GetOrAddNode(definition.Name);

        node.SetDefinition(definition);
        return(node);
    }
Exemple #2
0
    public IDisposable Add(IUIComponentDefinition definition)
    {
        var node = AddDefinition(definition);

        return(Disposable.Create(() =>
        {
            node.definition?.Dispose();
            node.definition = default;
        }));
    }
Exemple #3
0
    public IDisposable Add(UIComponentLocation location, IUIComponentDefinition definition)
    {
        var node = GetNode(location);

        node.AddDefinition(definition);

        return(Disposable.Create(() =>
        {
            node.definition?.Dispose();
            node.definition = default;
        }));
    }
Exemple #4
0
    private void SetDefinition(IUIComponentDefinition definition)
    {
        if (this.definition is null)
        {
            this.definition = definition;
            if (children is not null)
            {
                foreach (var item in children.Values.Where(n => n.definition is not null))
                {
                    item.definition !.OnParentDefined(definition);
                }
            }

            options?.ForEach(o => o(definition));

            definition.UpdateBindings(graph.ComponentContext);
        }

        foreach (var item in definition.Items)
        {
            GetOrAddNode(item.Name).SetDefinition(item);
        }
    }
Exemple #5
0
 void IUIComponentDefinition.OnParentDefined(IUIComponentDefinition parent)
 {
 }
 void IUIComponentDefinition.OnParentDefined(IUIComponentDefinition parent)
 => ((ToolBarDefinition)parent).Add(this);
Exemple #7
0
 void IUIComponentDefinition.OnParentDefined(IUIComponentDefinition parent)
 => ((IUIComponentDefinition <MenuItemDefinition>)parent).Add(this);