artem-zinnatullin / jet-image-loader

WP7+ fast and powerfull image loader with memory and storage caching for your projects!
Apache License 2.0
44 stars 14 forks source link

Invalid XAML #28

Open SnackSBR opened 10 years ago

SnackSBR commented 10 years ago

I'm trying to implement jet on my project but i have this error:

A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in System.Windows.ni.dll

Additional information: Cannot create instance of type 'Cartao_de_Visitas.Classes.JetImageLoaderConverter' [Line: 12 Position: 44]

And my page have this area as invalid XAML

                <DataTemplate>
                    <Grid Margin="12 0 12 0">
                        <Image Height="200" Source="{Binding ImageUrl, Converter={StaticResource JetImageLoaderConverter}}"/>
                    </Grid>
                </DataTemplate>
artem-zinnatullin commented 10 years ago

Did you declare JetImageLoaderConverter in the App.xaml?

You can check README.md and Sample app's App.xaml

SnackSBR commented 10 years ago

xmlns:app="clr-namespace:Cartao_de_Visitas.Classes"

< app:JetImageLoaderConverter x:Key="JetImageLoaderConverter" />

artem-zinnatullin commented 10 years ago

From README.md

<Application
    ...
    xmlns:myApp="clr-namespace:MyApp.NamespaceWithJetImageLoaderConverter>
<Application.Resources>
    <myApp:MyAppJetImageLoaderConverter x:Key="JetImageLoaderConverter"/>
</Application.Resources>
...

What is the name of your extended JetImageLoaderConverter class, are you sure that you declared it in the App.xaml correctly?

SnackSBR commented 10 years ago

http://pastebin.com/hiYB1PXJ http://pastebin.com/bWgJELES http://pastebin.com/bzJRKtQb

artem-zinnatullin commented 10 years ago

Looks valid, hmm... Are you building WP7 or WP8 project?

SnackSBR commented 10 years ago

wp8 project

artem-zinnatullin commented 10 years ago

Very strange.. Can you please clone repository and try to build JetImageLoader Sample project, may be something wrong with your OS config or something same?

SnackSBR commented 10 years ago

sample project runs just fine (already tried). very, very strange.

artem-zinnatullin commented 10 years ago

Yeah :( I don't know what to suggest for you, may be clean and rebuild of the project could help?

I can suggest to try to change some parts of JetImageLoader impementation, config, try to play with some parameters of JetImageLoader config as the error is Cannot create instance

SnackSBR commented 10 years ago

Tried to clean and rebuild too. I think its strange because the only difference from sample for mine is the converter name and with my converter name i get the invalid xaml. I'm missing something on the page apart from http://pastebin.com/pVyfJD4e or this is the only xaml modification needed?

artem-zinnatullin commented 10 years ago

Hmm, no, HorizontalContentAligment is not mandatory of course.

That is super strange I think, because I got two projects with different JetImageLoader names and configurations..

May be you should try to re-add JetImageLoader exactly as in the Sample app? I really don't know how to help you :(

SnackSBR commented 10 years ago

nugget version is the same from jet-image-loader-master/Releases ?

artem-zinnatullin commented 10 years ago

No, NuGet version is not so new as master branch, I can push new version but only tommorow, because I am on the Mac right now, I need Windows PC for that

I would recommend you to try add JetImageLoader as sources and if it works, then NuGet updated version should help you

SnackSBR commented 10 years ago

Tried and I don't get invalid XAML but still have A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in System.Windows.ni.dll

Additional information: Cannot create instance of type 'Cartao_de_Visitas.Classes.JetImageLoaderConverter' [Line: 12 Position: 44]

I'll keep trying. Thanks

artem-zinnatullin commented 10 years ago

That's very sad :( If I understand how to help you, I'll comment here

shobankr commented 10 years ago

I have the same problem :( tried three different new projects and same error. Sample project works fine. Tried the Nuget package, DLL from sample project and all give the same error.

shobankr commented 10 years ago

Okay I found a fix. instead of adding the name space and resource separately trying the following

< app:JetImageLoaderConverter x:Key="JetImageLoaderConverter" xmlns:app="clr-namespace:Cartao_de_Visitas.Classes"/>

artem-zinnatullin commented 10 years ago

Awesome! Thank you


Best regards, Artem Zinnatullin Sent from my bed. On Mar 23, 2014 7:15 PM, "shobankr" notifications@github.com wrote:

Okay I found a fix. instead of adding the name space and resource separately trying the following

< app:JetImageLoaderConverter x:Key="JetImageLoaderConverter" xmlns:app="clr-namespace:Cartao_de_Visitas.Classes"/>

— Reply to this email directly or view it on GitHubhttps://github.com/artem-zinnatullin/jet-image-loader/issues/28#issuecomment-38385222 .

SnackSBR commented 10 years ago

Thanks shobankr, i will try later.

sgraf812 commented 10 years ago

For me it helped to make the class public to it can be found by the runtime loader. This required for every value converter.