我想将RibbonWindow的标题居中,而不是让它在侧面对齐.
这个帖子说它有一个答案: 通过XAML Code中心WPF RibbonWindow标题
但它不起作用.
贝娄是一个图像和相应的代码.

<RibbonWindow x:Class="Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<Grid>
<Ribbon>
<Ribbon.TitleTemplate>
<DataTemplate>
<TextBlock TextAlignment="Center" HorizontalAlignment="Stretch" Width="{Binding ElementName=Window, Path=ActualWidth}">ApplicationTitle
<TextBlock.Effect>
<DropShadowEffect ShadowDepth="0" Color="MintCream " BlurRadius="10" />
</TextBlock.Effect>
</TextBlock>
</DataTemplate>
</Ribbon.TitleTemplate>
</Ribbon>
</Grid>
</RibbonWindow>
Run Code Online (Sandbox Code Playgroud)
我正在使用VS 2012,.NET 4.5和附带的System.Windows.Controls.Ribbon程序集.
| 归档时间: |
|
| 查看次数: |
3026 次 |
| 最近记录: |