How to erase port (like fontsize for TextBlock) from Windows Phone 8 Silverlight on Windows Phone 8.1 WinRT

I have an existing Windows Phone 8 Silverlight application with many different styles defined for TextBlocks on different pages.

Now I'm trying to migrate my entire project to a Universal Windows App, so the Windows Phone 8 Silverlight project needs to be converted to Windows Phone 8.1 WinRT. I can get most of the work besides the styles.

I'm having trouble getting styles mostly for TextBlocks. Similar fonts and fontfamily don't seem to display the same for Windows Phone 8.1 WinRT project.

Here's an example. I have the following style for a TextBlock

<Style x:Name="NormalStyle"
           TargetType="TextBlock">
    <Setter Property="Foreground"
                Value="Red" />
    <Setter Property="FontSize"
                Value="100" />
    <Setter Property="FontFamily"
                Value="Segoe WP" />
    <Setter Property="LineStackingStrategy"
                Value="BlockLineHeight" />
    <Setter Property="TextTrimming"
                Value="WordEllipsis" />
    <Setter Property="TextWrapping"
                Value="Wrap" />
</Style>

      

And I am using the same style in both Windows Phone 8 and Windows Phone 8.1 WinRT Silverlight projects as shown below.

<TextBlock Text="Hi"
               Style="{StaticResource NormalStyle}" />

      

This is how it looks in Windows Phone 8 Silverlight

enter image description here

This is how it looks in Windows Phone 8.1 WinRT

enter image description here

As you can see from the above images, the font size is much larger in Windows Phone 8.1 Universal App than Silverlight Windows Phone 8. So just copy pasting styles is not an option.

  • Is there a suggested / specific way to transfer my styles from Silverlight app to Windows Phone 8.1 WinRT app?
  • Something like WinRT fontsize 5 smaller than Silverlight fontsize?
  • Or do I have to go through each style and change one by one and compare both apps manually to conclude that the styles match exactly?
  • How about other styles (non-text block). Is there a way to send them?

I would be very happy if someone could point me in the right direction. Thanks in Advance.

+3


source to share


1 answer


The minimum effective resolution for Windows Phone 8 (and 8.1 silverlight) is 480x800.

On Windows Phone 8.1 XAML, the minimum effective resolution is 384x640

640 = 800 * 0.8



384 = 480 * 0.8

So, if you designed for 480x800 in Windows Phone 8 and now want to upgrade to Windows Phone 8.1, you need a few of all your hardcoded constants (height, width, font size, margin) by 0.8 to achieve the same screen size element for the new minimum effective resolution.

You can watch Peter Torr's great 2014 movie: http://channel9.msdn.com/Events/Build/2014/3-541 At 50.50 he mentions this fact.

+4


source







All Articles