Как центрировать TextBlock внутри GridViewColumn? (Пример xaml включен)

<Window x:Class="EffectsWindow.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        DataContext="{Binding RelativeSource={RelativeSource Self}}">

    <ListView ItemsSource="{Binding EffectsViewModel.Effects}">
        <ListView.View>
            <GridView>
                <GridViewColumn Width="200" Header="Effects">
                    <GridViewColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock HorizontalAlignment="Center"
                                       Text="{Binding Name}"
                                       TextAlignment="Center" />
                        </DataTemplate>
                    </GridViewColumn.CellTemplate>
                </GridViewColumn>
            </GridView>
        </ListView.View>
    </ListView>

</Window>

Эффект - это просто тип, имеющий свойство Name, которое возвращает строку, но текст по-прежнему не центрируется внутри его ячейки.

Любые идеи как это исправить?

5
задан Joan Venge 24 March 2011 в 20:10
поделиться