.NET 4.0 TextOptions.TextFormattingMode="Display" truncates tab labels on both left and right edges?
<ribbon:RibbonWindow x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ribbon="http://schemas.actiprosoftware.com/winfx/xaml/ribbon"
TextOptions.TextFormattingMode="Display"
Height="600" Width="800">
<DockPanel>
<ribbon:Ribbon DockPanel.Dock="Top">
<ribbon:Ribbon.Tabs>
<ribbon:Tab Label="Home" />
<ribbon:Tab Label="Validation" />
<ribbon:Tab Label="Storage" />
</ribbon:Ribbon.Tabs>
</ribbon:Ribbon>
<Label>
Notice how the longer tabs are cut off.
</Label>
</DockPanel>
</ribbon:RibbonWindow>
<ribbon:RibbonWindow x:Class="Pallas.GUI.TestWindow"
xmlns="http://schemas.microsoft.com/netfx/2007/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ribbon="http://schemas.actiprosoftware.com/winfx/xaml/ribbon"
Title="TestWindow">
<DockPanel LastChildFill="True">
<ribbon:Ribbon DockPanel.Dock="Top">
<ribbon:Tab Label="Algemeen"/>
<ribbon:Tab Label="A very, very long tab title"/>
</ribbon:Ribbon>
</DockPanel>
</ribbon:RibbonWindow>
public TestWindow()
{
Style defaultTextBlockStyle = new Style() { TargetType = typeof(TextBlock) };
defaultTextBlockStyle.Setters.Add(new Setter(TextBlock.FontSizeProperty, (double)20));
Application.Current.Resources.Add(typeof(TextBlock), defaultTextBlockStyle);
InitializeComponent();
}
Typeface typeface = new Typeface(this.LabelControl.FontFamily, this.LabelControl.FontStyle, this.LabelControl.FontWeight, this.LabelControl.FontStretch);
FormattedText text = new FormattedText(this.Label, CultureInfo.CurrentCulture, this.LabelControl.FlowDirection, typeface, this.LabelControl.FontSize, Brushes.Black);
Please log in to a validated account to post comments.