-
Notifications
You must be signed in to change notification settings - Fork 1
ComboBoxItemTextImage Class
Mauricio Jorquera edited this page Feb 10, 2026
·
6 revisions
Namespace: SCADtools.Revit.UI.OptionsBar
This class represents an item within the ObLabelComboBoxImage class and has two properties: ItemTitle and ItemText.
The following example creates a list of bar types and assigns it to the ItemText property of the ObLabelComboBoxImage object.
C#
ObLabelComboBoxImage labelComboBoxImage = new ObLabelComboBoxImage()
{
ItemsTextImage = GetRebarImages(),
ControlWidth = 220
};
private ObservableCollection<ComboBoxItemTextImage> GetRebarImages()
{
string title = "Rebar Shape : ";
string imageBaseUri = "pack://application:,,,/OptionsBarSample;component/Images/";
string[] shapes = { "B1", "B2", "B3" };
return new ObservableCollection<ComboBoxItemTextImage>(
shapes.Select(shape => new ComboBoxItemTextImage
{
ItemTitle = title,
ItemText = shape,
ItemImage = new BitmapImage(
new Uri($"{imageBaseUri}{shape}.png", UriKind.Absolute)),
IsVisibleImageCollapsed = true
})
);
}| Name | Description |
|---|---|
| ItemTitle | Gets or sets a title for the selected item to be displayed when the combobox is collapsed. |
| ItemText | Gets or sets the text associated with the selected item, which will be displayed in the expanded list when the combobox is dropped down. |
| ItemImage | Gets or sets the image associated with the selected item, which will be displayed in the expanded list when the combobox is dropped down. |
| IsVisibleImageCollapsed | Gets or sets the value that indicates whether the image associated with the selected item will be displayed when the combobox is collapsed. |
If the user does not want to display text in the ItemTitle property, they can leave it unassigned or set its value to empty.