Open v1rtu41m4n opened 7 years ago
the error persist I the resource is defined on the same page
<converters:IsLikeSetByProfileColorConverter x:Key="IsLikeSetByProfileColorConverter" />
I am having the same issue with IConverters as StaticResources not being found. I also have multiple RegisterAssemblyFromType statements in my MainActivity.cs, all for types that are in the same assembly. I do not have a Gorilla.json file.
<?xml version="1.0" encoding="utf-8"?>
<Application xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MyPOC.App" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
d1p1:Ignorable="d"
xmlns:converter="clr-namespace:MyPOC.Helpers;assembly=MyPOCPCL"
xmlns:local="clr-namespace:MyPOC.ViewModel;assembly=MyPOCPCL"
xmlns:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006"
>
<Application.Resources>
<!--Application resource dictionary-->
<ResourceDictionary >
<local:ViewModelLocator x:Key="Locator" />
<converter:GreaterThanZeroConverter x:Key="GreaterThanZeroConverter" />
<converter:NotConverter x:Key="NotConverter" />
<converter:DebugDataBindingConverter x:Key="DebugBinding" />
<Label Text="No Values" IsVisible="{Binding IsVisible, Converter={StaticResource GreaterThanZeroConverter}" />
LoadApplication(UXDivers.Gorilla.Droid.Player.CreateApplication(
this,
new UXDivers.Gorilla.Config("Good Gorilla")
.RegisterAssemblyFromType<MyPOC.App>()
.RegisterAssemblyFromType<ImageCircle.Forms.Plugin.Abstractions.CircleImage>()
.RegisterAssemblyFromType<MyPOC.CardView>()
.RegisterAssemblyFromType<MyPOC.ViewModel.ViewModelLocator>()
.RegisterAssemblyFromType<MyPOC.Helpers.DebugDataBindingConverter>()
.RegisterAssemblyFromType<MyPOC.Helpers.GreaterThanZeroConverter>()
.RegisterAssemblyFromType<MyPOC.Helpers.NotConverter>()
));
"StaticResource not found for key GreaterThanZeroConverter" The detail about the error: "Error loading XAML. The reported error: Xamarin.Forms.Xaml.XamlParseException:Position 27:49 Static Resource not found for key GreaterThanZeroConverter"
i had a problem with a specific IValueConverter, currently I have two on my page but in only crash with one of them, I already register the types on android main activity and configure it on gorilla.json (by the way both converter are in the same assembly same namespace) but I had have not luck, any help should be appreciated.
This is the xaml with the working converter:
<Grid HorizontalOptions="Fill" HeightRequest="266" IsVisible="{Binding Photo, Converter={StaticResource NullVisibilityConverter}}">
This is the xaml with the non working converter:
<Label Text="{Binding TotalLikes}" VerticalOptions="Center" TextColor="{Binding IsLikeSetByProfile, Converter={StaticResource IsLikeSetByProfileColorConverter}" />
Both converters are referenced in the resource dictionary of the app.xaml: `
this are the converters
`public class NullVisibilityConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { return !string.IsNullOrEmpty((string)value); }
`public class IsLikeSetByProfileColorConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { Color color = Color.Black;