Coder Social home page Coder Social logo

Comments (14)

roubachof avatar roubachof commented on August 11, 2024 5

thanks to @pictos here is the deal:

To consume types from the custom namespace schema, the XAML compiler requires that there's a code reference from the assembly that consumes the types, to the assembly that defines the types. This can be accomplished by adding a class containing an Init method to the assembly that defines the types that will be consumed through XAML:

from: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/xaml/custom-namespace-schemas#consuming-a-custom-namespace-schema

So for the namespace schema to work, you need to call initializer from App.xaml.cs like this:

        public App()
        {
            InitializeComponent();

            Sharpnado.Shades.Initializer.Initialize(false);
            Sharpnado.Tabs.Initializer.Initialize(true, true);
        }

from sharpnado.shadows.

themronion avatar themronion commented on August 11, 2024 4

@byme8 xmlns:shades="http://sharpnado.com" - change this to xmlns:shades="clr-namespace:Sharpnado.Shades;assembly=Sharpnado.Shadows"

from sharpnado.shadows.

roubachof avatar roubachof commented on August 11, 2024

Cannot replicate your issue

from sharpnado.shadows.

roubachof avatar roubachof commented on August 11, 2024

@themronion @byme8 how do you end up with this issue ?
what IDE are you using (including precise version number) ?

from sharpnado.shadows.

themronion avatar themronion commented on August 11, 2024

@roubachof I didn't even try to reproduce this issue, i just recommended the way i declare your plugin in xamls)

from sharpnado.shadows.

roubachof avatar roubachof commented on August 11, 2024

it's the new namespace attribute, it should work this way in the latest version

from sharpnado.shadows.

byme8 avatar byme8 commented on August 11, 2024

@themronion, with xmlns:shades="clr-namespace:Sharpnado.Shades;assembly=Sharpnado.Shadows" everything works as expected. Thanks!

@roubachof, I am using Microsoft Visual Studio Community 2019 Version 16.7.6. Also tested on VS For Mac 8.7.8.4 and got the same compilation error.

from sharpnado.shadows.

byme8 avatar byme8 commented on August 11, 2024

@roubachof

how do you end up with this issue?

I just installed the package and VS resolved namespace as xmlns:shades="http://sharpnado.com". That's all.

from sharpnado.shadows.

roubachof avatar roubachof commented on August 11, 2024

Which version of XF please ?

from sharpnado.shadows.

conor-codes avatar conor-codes commented on August 11, 2024

Same for me on version XF 4.8.0.1451 the syntax only shows xmlns:shades="http://sharpnado.com" when implementing in XAML

from sharpnado.shadows.

roubachof avatar roubachof commented on August 11, 2024

@dansiegel do you have an idea what is causing this. I could replicate it also. If you add as a nuget package and you add a Shadows, it is fine with the intellisense but you end up with a compile error...

from sharpnado.shadows.

dansiegel avatar dansiegel commented on August 11, 2024

I'm not sure what's causing this, I know that you have your preferred prefix as sho but I tried changing the xmlns to sho and got the same result. It seems very similar to xamarin/Xamarin.Forms#8451 but I believe that has to do with a project not having been compiled yet which wouldn't quite be the same issue when you're working with a nuget...

Perhaps someone on the Forms team can provide some input here... to me it looks like a problem with XamlC
@Redth @StephaneDelcroix @PureWeen

from sharpnado.shadows.

givod avatar givod commented on August 11, 2024

Giving the control a name solved it for me, "x:name" to the shadow control

from sharpnado.shadows.

roubachof avatar roubachof commented on August 11, 2024

Yup cause it generates a code reference to the assembly.

from sharpnado.shadows.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.