Wpf 需要将RadioButton中文本块的文本居中设置为ToggleButton样式

Wpf 需要将RadioButton中文本块的文本居中设置为ToggleButton样式,wpf,xaml,Wpf,Xaml,也尝试使用标签 按钮中的文本正在左对齐 <ItemsControl ItemsSource="{Binding ButtonLinks}"> <ItemsControl.ItemTemplate> <DataTemplate> <RadioButton Style="{StaticResource {x:Type ToggleButton}}"

也尝试使用标签

按钮中的文本正在左对齐

<ItemsControl ItemsSource="{Binding ButtonLinks}">
        <ItemsControl.ItemTemplate>
            <DataTemplate>
                <RadioButton Style="{StaticResource {x:Type ToggleButton}}"                                 
                             Margin="5"
                             Background="{x:Null}"
                             Height="40"
                             FontSize="14"
                             GroupName="Views"
                             FontWeight="Normal"
                             cal:Message.Attach="ShowPage">
                    <TextBlock Text="{Binding BtnText}"
                               TextAlignment="Center"
                               HorizontalAlignment="Center"
                               VerticalAlignment="Center"/>
                </RadioButton>
            </DataTemplate>
        </ItemsControl.ItemTemplate>
    </ItemsControl>

预计到达时间:

我使用的是MahApps.Metro overlay,当我删除App.xaml中的控件资源时,它就可以工作了,基本上有没有办法覆盖你拉入的资源上的属性,比如对齐

我从app.xaml中删除的行:

<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />


我必须覆盖mahapps库中设置为“左”的单选按钮的水平对齐。

该按钮的文本对我来说居中。你的“cal:Message.Attach”属性是什么?抱歉,意识到mahapps.metro正在这么做,现在想知道是否有方法只覆盖这一个属性。当我取出资源时,它正确居中,但我仍然需要按钮设计/样式。