Reputation: 1290
I'm having a strange issue with the clarity of text inside of a GroupBox (using the Material Design for WPF package).
In design view, everything looks normal:
However when I build the app, the GroupBox Header text ("Activity Feed:") is suddenly blurry:
No other controls are suffering this effect. I'm not using any custom styles. See XAML:
<GroupBox Margin="5 5 15 0" Name="ActivityFeedGroupbox" Header="Activity Feed:" Style="{DynamicResource MaterialDesignGroupBox}" materialDesign:ShadowAssist.ShadowDepth="Depth1" BorderThickness="0" Height="205">
<ListView Name="FeedListView" Margin="5 0 5 0">
<ListView.View>
<GridView>
<GridViewColumn Width="460">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding FeedData}">
<TextBlock.ToolTip>
<ToolTip Background="Gray">
<StackPanel>
<TextBlock Text="{Binding Tooltip}" Foreground="Black" />
</StackPanel>
</ToolTip>
</TextBlock.ToolTip>
</TextBlock>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
</GroupBox>
Thoughts on how to fix?
Upvotes: 1
Views: 632
Reputation: 51
The easiest way is to set:
UseLayoutRounding="True"
in the containing window. Another way is to change:
<GroupBox Margin="5 5 15 0" ...
to
<GroupBox Margin="5 6 15 0" ...
have a look how physical device pixels work:
https://wpftutorial.net/DrawOnPhysicalDevicePixels.html
Upvotes: 1
Reputation: 13835
You are missing TextOptions.TextFormattingMode="Display"
on your Window
. It's set for default wpf windows, but some custom theme authors forget about this setting.
Upvotes: 0