Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Style Static Resource

$
0
0

Hi guys,
I inserted in my App.xaml the following Style

<Application xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="myInventories.App">
<Application.Resources>
    <ResourceDictionary>
        <Style x:Key="WarmGreyLine" TargetType="BoxView">
            <Setter Property="HeightRequest" Value="1" />
            <Setter Property="HorizontalOptions" Value="Fill" />
            <Setter Property="Color" Value="#EEE9E5" />
            <Setter Property="Margin" Value="0,10,0,10" />
        </Style>
    </ResourceDictionary>
</Application.Resources>
</Application>

In a page I'm calling this with:

<BoxView Style="{StaticResource WarmGreyLine}" /> // This is the line 38

But I always receive:

Inner Exception: Position 38:14. StaticResource not found for key WarmGreyLine
Message: Exception has been thrown by the target of an invocation.

I can't understand what it is wrong. Thanks


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>