I already have the event, but when I want to put the image in the Combobox, the GetPreviewImage gets a Bitmap, as I take it to image in WPF
<Window x:Class="WpfRevit.Col_Ejemplares"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:WpfRevit"
mc:Ignorable="d" Title="WPF Colocar Ejemplar " WindowStartupLocation="CenterScreen" Width="400" Height="550" ResizeMode="CanResizeWithGrip">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="230"/>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<GroupBox >
<GroupBox.Header>
<TextBlock Text="Coordenadas" FontWeight="Bold" FontSize="20"/>
</GroupBox.Header>
<DataGrid />
</GroupBox>
<GroupBox Grid.Row="1">
<GroupBox.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Opciones" FontWeight="Bold" FontSize="20"/>
</StackPanel>
</GroupBox.Header>
</GroupBox>
<ComboBoxItem Grid.Row="1">
<Border Background="Lavender" BorderBrush="Gainsboro" BorderThickness="2" Grid.Row="1" Height="220">
<WrapPanel >
<Label Content="Categorias:" Width="148" VerticalAlignment="Top" Margin="20,20,0,0" FontSize="20" FontWeight="Bold" HorizontalAlignment="Left"></Label>
<ComboBox x:Name="cmbCategoria" Margin="0,20,0,0" Height="30" Width="202" FontSize="16" FontWeight="Bold" VerticalAlignment="Top" SelectionChanged="cmbCategoria_SelectionChanged"/>
<Label Content="Tipo de Familia:" Width="165" VerticalAlignment="Top" Margin="20,20,0,0" FontSize="20" FontWeight="Bold"></Label>
<Image x:Name="cmbImagen" >
</Image>
<ComboBox x:Name="cmbFamilias" Margin="0,20,0,0" Height="30" Width="170" VerticalAlignment="Top"
</WrapPanel>
</Border>
</ComboBoxItem>
<Button Content="Colocar Ejemplares" Grid.Row="2" FontSize="20" FontWeight="Bold"/>
</Grid>
</Window>
private void cmbFamilias_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
string nombre = this.cmbFamilias.SelectedItem.ToString();
List<FamilySymbol> Tipos = UtilRevit.ObtenerListaTiposFamiliySymbol(_doc);
FamilySymbol sym = Tipos.First(x => x.Family.Name + ":" + x.Name == nombre);
Size imgSize = new Size(200, 200);
this.cmbImagen.Source=sym.GetPreviewImage(imgSize);
}