Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

center picture horizontally in menu item of menu grid

$
0
0

I have a grid with cells that look pretty square. And a picture with a transparent background and square shape.

Using the picture on a top-level menu item. The menu control has RowSpan and ColumnSpan of 2 so it too is a square.

But I can't seem to get the picture to move to the right. Stays on the left. Ideally I'd want it to stretch across the 2x2 grid square but I could live with a centered view.

<Menu
	Grid.Row="0" Grid.Column="35" Grid.RowSpan="2" Grid.ColumnSpan="2"
	VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
	VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"
	Background="Transparent" BorderBrush="Transparent" BorderThickness="0"><MenuItem><MenuItem.Style><Style TargetType="MenuItem"><Setter Property="FontSize" Value="25" /><Setter Property="BorderThickness" Value="0" /><ignore:Setter Property="Height" Value="50" /></Style></MenuItem.Style><MenuItem.Icon ><Image Source="{DynamicResource SettingsButtonImage}" /></MenuItem.Icon><MenuItem.ItemsPanel><ItemsPanelTemplate><VirtualizingStackPanel Orientation="Vertical" /></ItemsPanelTemplate></MenuItem.ItemsPanel><MenuItem Name="menuPreferencesPanel" Header="Preferences"
				  Click="menuPreferencesPanel_Click" /><MenuItem Name="menuTuningPanel" Header="Tuning"
				  Click="menuTuningPanel_Click" /></MenuItem></Menu>

I have 'Height' ignored within the Style so it no longer is affecting the result. Even removed the Style but nothing changed.

Suggestions?



Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>