{"action":"created","issue":{"url":"https://api.github.com/repos/xamarin/Xamarin.Forms/issues/2782","repository_url":"https://api.github.com/repos/xamarin/Xamarin.Forms","labels_url":"https://api.github.com/repos/xamarin/Xamarin.Forms/issues/2782/labels{/name}","comments_url":"https://api.github.com/repos/xamarin/Xamarin.Forms/issues/2782/comments","events_url":"https://api.github.com/repos/xamarin/Xamarin.Forms/issues/2782/events","html_url":"https://github.com/xamarin/Xamarin.Forms/pull/2782","id":324644674,"node_id":"MDExOlB1bGxSZXF1ZXN0MTg5MTk3MzUx","number":2782,"title":"GH2691: Make XmlnsDefinitionAttribute public","user":{"login":"legistek","id":13384523,"node_id":"MDQ6VXNlcjEzMzg0NTIz","avatar_url":"https://avatars3.githubusercontent.com/u/13384523?v=4","gravatar_id":"","url":"https://api.github.com/users/legistek","html_url":"https://github.com/legistek","followers_url":"https://api.github.com/users/legistek/followers","following_url":"https://api.github.com/users/legistek/following{/other_user}","gists_url":"https://api.github.com/users/legistek/gists{/gist_id}","starred_url":"https://api.github.com/users/legistek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/legistek/subscriptions","organizations_url":"https://api.github.com/users/legistek/orgs","repos_url":"https://api.github.com/users/legistek/repos","events_url":"https://api.github.com/users/legistek/events{/privacy}","received_events_url":"https://api.github.com/users/legistek/received_events","type":"User","site_admin":false},"labels":[{"id":868986974,"node_id":"MDU6TGFiZWw4Njg5ODY5NzQ=","url":"https://api.github.com/repos/xamarin/Xamarin.Forms/labels/API-change","name":"API-change","color":"fbca04","default":false},{"id":772612655,"node_id":"MDU6TGFiZWw3NzI2MTI2NTU=","url":"https://api.github.com/repos/xamarin/Xamarin.Forms/labels/a/Xaml%20%3C/%3E","name":"a/Xaml </>","color":"dfe271","default":false},{"id":343860853,"node_id":"MDU6TGFiZWwzNDM4NjA4NTM=","url":"https://api.github.com/repos/xamarin/Xamarin.Forms/labels/t/enhancement%20%E2%9E%95","name":"t/enhancement ➕","color":"84b6eb","default":false}],"state":"open","locked":false,"assignee":{"login":"StephaneDelcroix","id":313003,"node_id":"MDQ6VXNlcjMxMzAwMw==","avatar_url":"https://avatars0.githubusercontent.com/u/313003?v=4","gravatar_id":"","url":"https://api.github.com/users/StephaneDelcroix","html_url":"https://github.com/StephaneDelcroix","followers_url":"https://api.github.com/users/StephaneDelcroix/followers","following_url":"https://api.github.com/users/StephaneDelcroix/following{/other_user}","gists_url":"https://api.github.com/users/StephaneDelcroix/gists{/gist_id}","starred_url":"https://api.github.com/users/StephaneDelcroix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StephaneDelcroix/subscriptions","organizations_url":"https://api.github.com/users/StephaneDelcroix/orgs","repos_url":"https://api.github.com/users/StephaneDelcroix/repos","events_url":"https://api.github.com/users/StephaneDelcroix/events{/privacy}","received_events_url":"https://api.github.com/users/StephaneDelcroix/received_events","type":"User","site_admin":false},"assignees":[{"login":"StephaneDelcroix","id":313003,"node_id":"MDQ6VXNlcjMxMzAwMw==","avatar_url":"https://avatars0.githubusercontent.com/u/313003?v=4","gravatar_id":"","url":"https://api.github.com/users/StephaneDelcroix","html_url":"https://github.com/StephaneDelcroix","followers_url":"https://api.github.com/users/StephaneDelcroix/followers","following_url":"https://api.github.com/users/StephaneDelcroix/following{/other_user}","gists_url":"https://api.github.com/users/StephaneDelcroix/gists{/gist_id}","starred_url":"https://api.github.com/users/StephaneDelcroix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StephaneDelcroix/subscriptions","organizations_url":"https://api.github.com/users/StephaneDelcroix/orgs","repos_url":"https://api.github.com/users/StephaneDelcroix/repos","events_url":"https://api.github.com/users/StephaneDelcroix/events{/privacy}","received_events_url":"https://api.github.com/users/StephaneDelcroix/received_events","type":"User","site_admin":false},{"login":"rmarinho","id":1235097,"node_id":"MDQ6VXNlcjEyMzUwOTc=","avatar_url":"https://avatars3.githubusercontent.com/u/1235097?v=4","gravatar_id":"","url":"https://api.github.com/users/rmarinho","html_url":"https://github.com/rmarinho","followers_url":"https://api.github.com/users/rmarinho/followers","following_url":"https://api.github.com/users/rmarinho/following{/other_user}","gists_url":"https://api.github.com/users/rmarinho/gists{/gist_id}","starred_url":"https://api.github.com/users/rmarinho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmarinho/subscriptions","organizations_url":"https://api.github.com/users/rmarinho/orgs","repos_url":"https://api.github.com/users/rmarinho/repos","events_url":"https://api.github.com/users/rmarinho/events{/privacy}","received_events_url":"https://api.github.com/users/rmarinho/received_events","type":"User","site_admin":false}],"milestone":null,"comments":22,"created_at":"2018-05-19T17:08:11Z","updated_at":"2018-11-09T15:10:15Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/xamarin/Xamarin.Forms/pulls/2782","html_url":"https://github.com/xamarin/Xamarin.Forms/pull/2782","diff_url":"https://github.com/xamarin/Xamarin.Forms/pull/2782.diff","patch_url":"https://github.com/xamarin/Xamarin.Forms/pull/2782.patch"},"body":"### Description of Change ###\r\n\r\nThis makes `XmlnsDefinitionAttribute` `public` and enables it to be used with any assembly in the project to map C# namespaces to custom URLs.\r\n\r\n### Bugs Fixed ###\r\n\r\nFixes #2691\r\nAlso resolves what may be an un-logged bug preventing using `x:Name` with elements referenced with `using:` style namespace definitions.\r\n\r\n### API Changes ###\r\n\r\nAdded:\r\n None\r\n\r\nChanged:\r\n - `XmlnsDefinitionAttribute` to the `Xamarin.Forms.Xaml` namespace and the `public` accessibility modifier (was `internal`)\r\n - XamlG, XamlC, and XamlParser have been changed to look for all referenced assemblies with the `XmlnsDefinitionAttribute` as opposed to only looking in `Xamarin.Forms.Core` and `Xamarin.Forms.Xaml`. Specifically:\r\n\r\n1. The XamlG build task now takes a `References` input from MSBuild, consisting of a semicolon-separated list of paths to referenced assemblies in the project, and provides this to `XamlGenerator`. `XamlGenerator` now looks for `XmlnsDefinitionAttribute` in these assemblies, and then resolves type references using Mono APIs. Several members had to be changed from `static` in order to have access to the referenced assembly list. XamlG also checks for `using:` at the beginning of namespace URIs and handles these correctly.\r\n2. The `XmlTypeExtensions.GatherXmlnsDefinitionAttributes` method used by the XamlC build task now uses the `ModuleDefinition` being compiled to look for referenced assemblies. In addition, rather than maintaining a single static list of `XmlnsDefinitionAttribute`s, a `Dictionary` is used to maintain individual lists for each `ModuleDefinition`, and the procedure is thread-safe. This seemed necessary in case there are multiple concurrent compilations occurring under the same XamlC process.\r\n3. The `XamlParser` looks for the `XmlnsDefinitionAttribute` in all assemblies in the current `AppDomain`. \r\n\r\n### Behavioral Changes ###\r\n\r\nThe `XmlnsDefinitionAttribute` can now be applied to any assembly with CLR namespaces mapped to any custom URL namespace. The namespaces are recognized for all purposes: code-behind generation, XAML compiling, runtime XAML parsing, and IntelliSense. \r\n\r\nNote that for the behavior to work correctly on all platforms, the `Preserve` attribute must be applied to any classes in the assembly that will fall under the custom URL scheme,, if not the entire assembly. In addition, the assembly with the custom-mapped classes must be referenced in the actual code of the assembly that contains the XAML referencing the custom URL. This can be accomplished by having the consuming assembly call a simple, empty `Init` method in the control library, similar to what is necessary when making custom platform renderers. \r\n\r\nFinally, when making unit tests, I discovered that when employing the `using:` syntax to specify a namespace URI, it was not possible to add an `x:Name` to these elements because XamlG was not checking for `using:` at the beginning of the URI. This has been fixed.\r\n\r\n### PR Checklist ###\r\n\r\n- [X] Has tests (if omitted, state reason in description)\r\n- [X] Rebased on top of the target branch at time of PR\r\n- [X] Changes adhere to coding standard\r\n- [X] Consolidate commits as makes sense"},"comment":{"url":"https://api.github.com/repos/xamarin/Xamarin.Forms/issues/comments/437388194","html_url":"https://github.com/xamarin/Xamarin.Forms/pull/2782#issuecomment-437388194","issue_url":"https://api.github.com/repos/xamarin/Xamarin.Forms/issues/2782","id":437388194,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzM4ODE5NA==","user":{"login":"legistek","id":13384523,"node_id":"MDQ6VXNlcjEzMzg0NTIz","avatar_url":"https://avatars3.githubusercontent.com/u/13384523?v=4","gravatar_id":"","url":"https://api.github.com/users/legistek","html_url":"https://github.com/legistek","followers_url":"https://api.github.com/users/legistek/followers","following_url":"https://api.github.com/users/legistek/following{/other_user}","gists_url":"https://api.github.com/users/legistek/gists{/gist_id}","starred_url":"https://api.github.com/users/legistek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/legistek/subscriptions","organizations_url":"https://api.github.com/users/legistek/orgs","repos_url":"https://api.github.com/users/legistek/repos","events_url":"https://api.github.com/users/legistek/events{/privacy}","received_events_url":"https://api.github.com/users/legistek/received_events","type":"User","site_admin":false},"created_at":"2018-11-09T15:10:15Z","updated_at":"2018-11-09T15:10:15Z","author_association":"NONE","body":"Hi @StephaneDelcroix  Sorry for all the git messages. It's ready for you now. I addressed your comments and also updated to incorporate what you merged in yesterday. Let me know if want me to change anything else."}}
{"actor":{"display_login":"legistek"}}