I need an item control with popup (because I need to use it in a data grid so when it is expanded the column width is not affected) which presents items horizontally. Ideally it would be combobox with horizontal "drop-down". Even better if it doesnt drop down but pop up above the center of the combo button (selecting item or Esc key would close it). Items are fixed size squares 30x30 and few in number, so scroll view is not needed.
I found this "code" which doesnt work at all (nothing renders on the screen):
<ComboBox HorizontalAlignment="Left" VerticalAlignment="Top" Width="120">
<ComboBox.Items>
<ComboBoxItem>Item 1</ComboBoxItem>
<ComboBoxItem>Item 2</ComboBoxItem>
<ComboBoxItem>Item 3</ComboBoxItem>
</ComboBox.Items>
<ComboBox.ItemContainerStyle>
<Style TargetType="{x:Type ComboBoxItem}">
<Setter Property="HorizontalContentAlignment" Value="Center"/>
</Style>
</ComboBox.ItemContainerStyle>
<ComboBox.Template>
<ControlTemplate TargetType="{x:Type ComboBox}">
<Grid>
<Popup x:Name="PART_Popup" AllowsTransparency="true" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom">
<Border x:Name="DropDownBorder" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1">
<ScrollViewer x:Name="DropDownScrollViewer">
<StackPanel IsItemsHost="true"/>
</ScrollViewer>
</Border>
</Popup>
</Grid>
</ControlTemplate>
</ComboBox.Template>
</ComboBox>
How to make it work?