如何在Revit API中的RibbonPanel中设置PushButton的对齐方式

时间:2016-10-20 15:08:33

标签: c# wpf revit-api

public void BuildRibbon(UIControlledApplication application)
    {
        foreach (var bc in _container.GetExports<IExternalCommand, IButtonMetaData>().OrderBy(l => l.Metadata.PanelIndex))
        {
            var md = bc.Metadata;
            var cmdType = bc.Value.GetType();
            var assembly = cmdType.Assembly;
            var panel = application.RibbonPanel(bc.Metadata.TabName, bc.Metadata.PanelName);
             PushButton button;

            button = (PushButton)panel.AddItem(new PushButtonData(md.Name, md.Text, assembly.Location, cmdType.FullName));

            if (button == null) continue;

            button.Enabled = md.Enabled;
            button.Visible = md.Visible;
        }
    }

我无法在RibbonPanel中设置PushButton的对齐方式。我想把它转移到Panal的右侧。我需要在这里设置对齐属性,我不能找到按钮的任何对齐属性

1 个答案:

答案 0 :(得分:0)

Afaik,Revit API不提供任何直接支持。另一方面,按钮或多或少是一个直接的.NET对象。您是否搜索过它提供的标准.NET属性?