0
It says that Badeview does not exist in the current context in this line of sham.g.Cs
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Forms.Build.Tasks.XamlG", "0.0.0.0")]
private global::Xamarin.Forms.BadgeView bdgDesvioFat;
How do we fix 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 shaman
<BadgeView Grid.Row="0" Grid.Column="0" Grid.RowSpan="2"
x:Name="bdgDesvioFat"
BadgeColor="Blue"/>
EDIT1
After altering my page at Diego’s suggestion, you made that mistake
[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 statement of the page where I want to display the badge. You have more image to display. Not to get too big the post, I put only these since the rest is 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 rotate
EDIT3 error:
Type Imageresource not found in xmlns clr-namespace:Operacional
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 fix it?
On your Grid, you have improperly placed the namespace
local
and I’m not sure if the rest of the content is correct... I think it should be<Image x:Name="imgDesvioFat" Grid.Row="1" Grid.Column="0" Source="caixa-28.png" Aspect="AspectFill">
only. But the question is shifting the original focus and I do not believe that at this point is useful to the community.– Diego Rafael Souza