Application Resources do not appear to be applied to UWP app

I have the following in my App.xaml

<?xml version="1.0" encoding="utf-8" ?>

<Application.Resources>


<OnPlatform.iOS>0</OnPlatform.iOS>
<OnPlatform.Android>0</OnPlatform.Android>
<OnPlatform.WinPhone>0</OnPlatform.WinPhone>

        <OnPlatform x:Key="CustColSpacing" x:TypeArguments="x:Double">
            <OnPlatform.iOS>0</OnPlatform.iOS>
            <OnPlatform.Android>4</OnPlatform.Android>
            <OnPlatform.WinPhone>8</OnPlatform.WinPhone>
        </OnPlatform>


        <Style TargetType="Grid">
            <Setter Property="RowSpacing" Value="{StaticResource CustRowSpacing}" />
            <Setter Property="ColumnSpacing" Value="{StaticResource CustColSpacing}" />
        </Style>

        <OnPlatform x:Key="CustStackSpacing" x:TypeArguments="x:Double">
            <OnPlatform.iOS>0</OnPlatform.iOS>
            <OnPlatform.Android>0</OnPlatform.Android>
            <OnPlatform.WinPhone>0</OnPlatform.WinPhone>
        </OnPlatform>

        <Style TargetType="StackLayout">
            <Setter Property="Spacing" Value="{StaticResource CustStackSpacing}" />
        </Style>

        <Style TargetType="Button">
            <Setter Property="BorderWidth" Value="0" />
            <Setter Property="BackgroundColor" Value="Transparent" />
            <Setter Property="BorderColor" Value="Transparent" />
            <Setter Property="BorderRadius" Value="0"/>
        </Style>

    </ResourceDictionary>
</Application.Resources>

When I have a WinPhone 8.1 app in the project everything looked fine. I have since removed the WinPhone 8.1 app and added a UWP app. The spacing in the UWP app when running on the WinPhone is not what is set in the ResourceDictionary. Also the font sizes (small, medium, large etc.) do not seem to be translating correctly either.

I have attached a screen shot

Sign In or Register to comment.