Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

XmlnsDefinition don't work if add xct csproj to my project #1321

Answered by auriou
auriou asked this question in Q&A
Discussion options

You must be logged in to vote

Here's how to reproduce the error

for this to work, you have to add a static class which serves just as an initializer, and apply it just after the initialization of your application's initializer

// into Xamarin.CommunityToolkit project
namespace Xamarin.CommunityToolkit
{
	public static class Initializer
	{
		public static void Init()
		{
		}
	}
}

// into your project 
namespace MyApp
{
    public partial class App : Application
    {
        public App()
        {
            InitializeComponent();
            Xamarin.CommunityToolkit.Initializer.Init();
        }
    }
}

Replies: 4 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@auriou
Comment options

Comment options

You must be logged in to vote
1 reply
@auriou
Comment options

Comment options

You must be logged in to vote
4 replies
@pictos
Comment options

@auriou
Comment options

@pictos
Comment options

@auriou
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by auriou
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants