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

Global Resources in xaml

$
0
0

I followed the instructions xamarin form styles walk through. Here is my app.xaml

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

<Application.Resources>

MPS Mobile Driver




</Application.Resources>

I try to use the AppName item in a xaml ContentPage as follows:

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

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
        <RowDefinition />
    </Grid.RowDefinitions>

    <!--<Label Grid.Row="0" Text="{Binding MainText}" VerticalOptions="Center" HorizontalOptions="Center" />-->
    <Label Grid.Row="0" Text="{StaticResource AppName}" VerticalOptions="Center" HorizontalOptions="Center" />
</Grid>

I get an error that it can't find the static resource AppName. Can anyone help?

Also, the {Binding MainText} was created by the template, but nothing ever showed up in it.

Jim


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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