Пример #1
0
        public void BuildToolBar(ToolBarDefinition toolBarDefinition, IToolBar result)
        {
            var groups = _toolBarItemGroups
                         .Where(x => x.ToolBar == toolBarDefinition)
                         .OrderBy(x => x.SortOrder)
                         .ToList();

            for (int i = 0; i < groups.Count; i++)
            {
                var group        = groups[i];
                var toolBarItems = _toolBarItems
                                   .Where(x => x.Group == group)
                                   .OrderBy(x => x.SortOrder);

                foreach (var toolBarItem in toolBarItems)
                {
                    result.Add(new CommandToolBarItem(toolBarItem, _commandService.GetCommand(toolBarItem.CommandDefinition), result));
                }

                if (i < groups.Count - 1 && toolBarItems.Any())
                {
                    result.Add(new ToolBarItemSeparator());
                }
            }
        }
Пример #2
0
    public DefinedToolBarViewModel(ToolBarDefinition definition)
    {
        Definition = definition ?? throw new ArgumentNullException(nameof(definition));

        items = definition.Items.ToReadOnlyObservableCollectionOf(d => d.Build());

        changeSubscription = definition.Changed.Subscribe(n =>
        {
            this.RaisePropertyChanged(n.PropertyName);
        });
    }
Пример #3
0
 public ToolBarItemGroupDefinition(ToolBarDefinition toolBar, int sortOrder)
 {
     ToolBar   = toolBar;
     SortOrder = sortOrder;
 }
 public ToolBarItemGroupDefinition(ToolBarDefinition toolBar, int sortOrder)
 {
     IoC.RegisterConstant(this);
     ToolBar   = toolBar;
     SortOrder = sortOrder;
 }
Пример #5
0
 public ExcludeToolBarDefinition(ToolBarDefinition toolBarDefinition)
 {
     _toolBarDefinitionToExclude = toolBarDefinition;
 }
 public ExcludeToolBarDefinition(ToolBarDefinition toolBarDefinition)
 {
     ToolBarDefinitionToExclude = toolBarDefinition;
 }
Пример #7
0
 public ToolBarItemGroupDefinition(ToolBarDefinition toolBar, int sortOrder)
 {
     _toolBar = toolBar;
     _sortOrder = sortOrder;
 }