private RibbonItemListDisplay GetRibbonItemListDisplay(IRibbonControl item) {
var rils = new RibbonItemListDisplay() {
SourceControl = item,
HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch,
Header = (item.Header as string),
ItemName = (item as FrameworkElement).Name
};
if (item.Icon != null) {
if (item.Icon is String)
rils.Icon = new BitmapImage(new Uri(@"/BetterExplorer;component/" + item.Icon.ToString(), UriKind.Relative));
else
rils.Icon = (item.Icon as Image).Source;
}
if (item is Fluent.DropDownButton || item is Fluent.SplitButton || item is Fluent.InRibbonGallery) {
rils.ShowMenuArrow = true;
}
else if (item is Fluent.CheckBox) {
rils.ShowCheck = true;
}
return rils;
}