I saw I had not always SnapToDevicePixels added to all elements in my test Xaml, and when I added that, the elements rendered sharp.
Until I collapsed the Expander, then the collapsed element was blurry as hell.
What I wonder is: in all your demos of the WpfDiagram control, you don't have blurry text once, also not with the HTML-like elements. It's of course unacceptable for us to have blurry elements on the diagram, but as your demos never show blurryness, I wonder where the error might be, as it IS possible (your demos show that
).
I read the thread, and I agree, it's the main reason why we opted for yet another Winforms based main UI, however for diagramming, Wpf seems easier, at least, at first, however it more and more starts to become a true pain as well...
I've specified my (modified test) xaml below.
<UserControl x:Class="SD.LLBLGen.Pro.Gui.Controls.WPF.EntityGlyph"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:c="clr-namespace:SD.LLBLGen.Pro.ApplicationCore.EntityModel;assembly=SD.LLBLGen.Pro.ApplicationCore"
Width="150" SnapsToDevicePixels="True" Focusable="True" Height="Auto">
<UserControl.Resources>
<DataTemplate x:Key="itemTemplate">
<TextBlock Text="{Binding Path=Name}" FontSize="10" SnapsToDevicePixels="True"/>
</DataTemplate>
</UserControl.Resources>
<Border BorderBrush="Black" BorderThickness="0.5" CornerRadius="10" Padding="5" SnapsToDevicePixels="True">
<Border.BitmapEffect>
<DropShadowBitmapEffect Softness="0.355"/>
</Border.BitmapEffect>
<Border.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFFDEEEE" Offset="1"/>
<GradientStop Color="#FFF90909" Offset="0"/>
</LinearGradientBrush>
</Border.Background>
<StackPanel Height="Auto" Width="Auto" SnapsToDevicePixels="True">
<Label VerticalAlignment="Top" Height="Auto" Width="Auto" Content="{Binding Path=Name}" x:Name="_nameLabel" FontWeight="Bold"
FontSize="16" FontFamily="Tahoma" HorizontalContentAlignment="Center" Foreground="#FFFDEEEE" SnapsToDevicePixels="True"/>
<Expander x:Name="_fieldExpander" Height="Auto" Width="Auto" Header="Fields" IsExpanded="True" SnapsToDevicePixels="True">
<ListBox x:Name="_fieldsListBox" ItemsSource="{Binding Path=Fields}" BorderThickness="0">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Name}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Expander>
</StackPanel>
</Border>
</UserControl>
(updated the xaml a bit, it contained a lot of left-over crap from tests).
Even with a fixed width, it becomes blurry when collapsing the expander. It seems the element is rendered 1-2 pixels left of where it was. As your diagram does the positioning, I'm not sure if this is due to some wrapping code in the diagram item wrrapper.