How can I convert this code part from XAML to C# code?
<ComboBoxItem x:Name="cmbItemDashDot1">
<Viewbox>
<Image Height="18" Width="70">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<GeometryDrawing Brush="Black">
<GeometryDrawing.Geometry>
<LineGeometry StartPoint="0,9" EndPoint="38,9" />
</GeometryDrawing.Geometry>
<GeometryDrawing.Pen>
<Pen Brush="Black" Thickness="1" DashStyle="{x:Static DashStyles.DashDot}"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</Viewbox>
</ComboBoxItem>
I can not find analogies for some elements. Or How can I draw a line in ComboBoxItem programmatically?
System.Windows.MediaComboBoxItemisSystem.Windows.Controls.ComboBoxItem(or just addusing System.Windows.Controls;). If problem is that, then you can use google to find in which namespace is control (type "wpf controlname"). Or just right clickComboBoxItemtext in code and choose Resolve and intellisense will fix it for you.