It says that BadeView does not exist in the current context in this line of xaml.g.cs
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Forms.Build.Tasks.XamlG", "0.0.0.0")]
private global::Xamarin.Forms.BadgeView bdgDesvioFat;
How to solve this? My BadgeView
<?xml version="1.0" encoding="utf-8" ?>
<Grid
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:local="clr-namespace:Operacional"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Operacional.BadgeView"
HeightRequest="16"
WidthRequest="16">
<local:CircleView x:Name="BadgeCircle"
HeightRequest="16"
WidthRequest="16"
CornerRadius="16"
VerticalOptions="Center"
HorizontalOptions="Center" />
<Label x:Name="BadgeLabel"
TextColor="White"
VerticalOptions="Center"
HorizontalOptions="Center"
VerticalTextAlignment="Center"
HorizontalTextAlignment="Center"
FontSize="10"/>
</Grid>
and here I call the BadgeView inside the xaml
<BadgeView Grid.Row="0" Grid.Column="0" Grid.RowSpan="2"
x:Name="bdgDesvioFat"
BadgeColor="Blue"/>
EDIT1
After changing my page with Diego's suggestion, he started giving this error
[global :: System.CodeDom.Compiler.GeneratedCodeAttribute ("Xamarin.Forms.Build.Tasks.XamlG", "0.0.0.0")] private global :: Operational.ViewModels.BadgeView bdgDesvioFat;
EDIT2
This is the xaml declaration of the page where I want to display the badge. You have more image to display. In order not to get too big the post, I put only those ones since the others are all similar.
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Operacional.Views.Indicadores"
xmlns:local="clr-namespace:Operacional.ViewModels"
xmlns:badge="clr-namespace:Operacional.BadgeView.Shared;assembly=BadgeView.Shared"
Title="[email protected]"
Icon="person.png"
>
<ContentPage.Content>
<StackLayout Padding="0" Spacing="0" Margin="0">
<local:BadgeView x:Name="bdgDesvioFat"
BadgeColor="Blue"/>
<Grid x:Name="grd" RowSpacing="1" ColumnSpacing="1" Padding="0" Margin="0" >
<Grid.RowDefinitions>
<RowDefinition Height="1" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Image x:Name="imgDesvioFat" Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Source="{local:ImageResource Operacional.Images.faturamento caixa-28.png}" Aspect="AspectFill">
<Image.GestureRecognizers>
<TapGestureRecognizer Tapped="OnDesvioFaturamentoTapReconizerTapped" NumberOfTapsRequired="1"></TapGestureRecognizer>
</Image.GestureRecognizers>
</Image>
<!--<Label x:Name="lblFaturamento" Text="" Grid.Row="0" Grid.Column="0" TextColor="White" FontSize="9" FontAttributes="Bold" />-->
<!--</Grid>-->
<Image x:Name="imgTckCancelados" Grid.Row="1" Grid.Column="1" Source="{local:ImageResource Operacinal.Images.tickets cancelados-05.png}" Aspect="AspectFill">
<Image.GestureRecognizers>
<TapGestureRecognizer Tapped="OnTckCanceladosTapGestureReconizerTapped" NumberOfTapsRequired="1"></TapGestureRecognizer>
</Image.GestureRecognizers>
</Image>
What can I do to improve this and run
EDIT3 error:
Type ImageResource not found in xmlns clr-namespace: Operational
I did this, following the tip of colleague Diego
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Operacional.Views.Indicadores"
xmlns:local="clr-namespace:Operacional"
Title="[email protected]"
Icon="person.png"
>
<ContentPage.Content>
<StackLayout Padding="0" Spacing="0" Margin="0">
<local:BadgeView x:Name="bdgDesvioFat"
BadgeColor="Blue"/>
<Grid x:Name="grd" RowSpacing="1" ColumnSpacing="1" Padding="0" Margin="0" >
<Grid.RowDefinitions>
<RowDefinition Height="1" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Image x:Name="imgDesvioFat" Grid.Row="1" Grid.Column="0" Source="{local:ImageResource Operacional.Images.faturamento caixa-28.png}" Aspect="AspectFill">
<Image.GestureRecognizers>
<TapGestureRecognizer Tapped="OnDesvioFaturamentoTapReconizerTapped" NumberOfTapsRequired="1"></TapGestureRecognizer>
</Image.GestureRecognizers>
</Image>
How do I resolve this?