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()); } } }
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); }); }
public ToolBarItemGroupDefinition(ToolBarDefinition toolBar, int sortOrder) { ToolBar = toolBar; SortOrder = sortOrder; }
public ToolBarItemGroupDefinition(ToolBarDefinition toolBar, int sortOrder) { IoC.RegisterConstant(this); ToolBar = toolBar; SortOrder = sortOrder; }
public ExcludeToolBarDefinition(ToolBarDefinition toolBarDefinition) { _toolBarDefinitionToExclude = toolBarDefinition; }
public ExcludeToolBarDefinition(ToolBarDefinition toolBarDefinition) { ToolBarDefinitionToExclude = toolBarDefinition; }
public ToolBarItemGroupDefinition(ToolBarDefinition toolBar, int sortOrder) { _toolBar = toolBar; _sortOrder = sortOrder; }