tags:

views:

323

answers:

2
+1  A: 

Does the "Path" object have an "Align" property? That is, can you force it to align right with this XAML?

<Path Grid.Column="1" Align="Right" Style={StaticResource StarStyle}/>

Edit

No, it doesn't. In that case, I'd suggest embedding the path into a container that can align it. Perhaps:

<DockPanel Grid.Column="1">
    <Path DockPanel.Dock="Right" Style={StaticResource StarStyle}/>
</DockPanel>
Matt Hamilton
Thanks for your help, but I already found the solution. See my answer.
Robbert Dam
+1  A: 

I forgot to mention that I've defined this Style

        <Style x:Key="ComboItemsStyle" TargetType="{x:Type ComboBoxItem}">
            <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        </Style>

Assigning this style to my ComboBox solves it:

        <Style x:Key="ComboStyle" TargetType="{x:Type ComboBox}">
            <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        </Style>
Robbert Dam
Ah of course - the "stretch" thing is a common problem with ComboBoxes and ListBoxes. I wish MS had made it the default, because *everybody* makes the same mistake (myself included).
Matt Hamilton