We have two textBlocks like this: (we used .NET FW 3.0)
<TextBlock Grid.Column="0" Name="tabName" Style="{StaticResource textBlockBarStyle}" HorizontalAlignment="Left">
<TextBlock.Margin>
<Binding Converter="{StaticResource dpiConverter}">
<Binding.ConverterParameter>
<Thickness Left="3" Top="6" Right="0" Bottom="0"/>
</Binding.ConverterParameter>
</Binding>
</TextBlock.Margin>
</TextBlock>
and
<TextBox x:Name="txtBoxHelp"
IsReadOnly="True" Style="{DynamicResource txtBoxHelpStyle}"
IsTabStop="False"
Text="some text" MouseLeftButtonDown="txtBoxHelp_MouseLeftButtonDown">
<TextBox.Margin>
<Binding Converter="{StaticResource dpiConverter}">
<Binding.ConverterParameter>
<Thickness Left="7" Top="0" Right="0" Bottom="0"/>
</Binding.ConverterParameter>
</Binding>
</TextBox.Margin>
</TextBox>
These two textBlocks work well on other OS-es, but sometimes miss on the Windows XP Home Version with SP3. We have tried many ways to refresh these, but failed.
We tried:
- UpdateLayout
- InvalidateVisual
- Changed the set Text property in code to binding mode.
How to force these controls to refresh?