Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XAML Intellisense for inner elements #1407

Closed
4 of 5 tasks
ghuntley opened this issue Aug 22, 2019 · 16 comments
Closed
4 of 5 tasks

XAML Intellisense for inner elements #1407

ghuntley opened this issue Aug 22, 2019 · 16 comments
Labels
area/vswin Categorizes an issue or PR as relevant to Visual Studio for Windows difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/enhancement New feature or request platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform project/core-tools 🛠️ Categorizes an issue or PR as relevant to core and tools

Comments

@ghuntley
Copy link
Member

Current behavior

  1. Install https://marketplace.visualstudio.com/items?itemName=nventivecorp.uno-platform-addin
  2. Create a new project using the Cross-Platform App (Uno Platform) app project template
  3. Close the project (see https://developercommunity.visualstudio.com/content/problem/587976/xaml-intellisense-does-not-start-properly-on-proje.html)
  4. Open the MainPage.xaml file in the MyApp.Shared\MainPage.xaml
  5. In the project selector, select “MyProject.Droid”
  6. Notice that the Page element is properly recognized by the editor, but the inner elements are not with the message The type Page does not support direct content, even if the type Page has ContentPropertyAttribute defined in its base classes.

Anything else we need to know?

Feedback from https://developercommunity.visualstudio.com/content/problem/587980/xaml-intellisense-does-not-use-contentpropertyattr.html and a recent video call with the Visual Studio team recommended that we look at the Xamarin.Forms project. Specifically ContentPropertyAttributes need to be moved out of Uno.UI.dll and into a design assembly. ie.

image

https://github.com/xamarin/Xamarin.Forms/tree/master/Xamarin.Forms.Core.Design

For which Platform:

  • iOS
  • Android
  • WebAssembly
  • Visual Studio for Windows
  • Windows
@ghuntley ghuntley added kind/enhancement New feature or request platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform triage/untriaged Indicates an issue requires triaging or verification area/vswin Categorizes an issue or PR as relevant to Visual Studio for Windows kind/consumer-experience labels Aug 22, 2019
@ghuntley ghuntley removed the triage/untriaged Indicates an issue requires triaging or verification label Aug 26, 2019
@jeromelaban
Copy link
Member

Moving the attribute out seems like an extremely bad idea, on many levels. Also, that's not what Xamarin.Forms is doing, as the ContentPropertyAttribute is defined in Xamarin.Forms.Core, not in the design assembly.

Maybe the VS designer is looking for the design assembly and looks for the attribute there. We can try creating such an assembly and add references to Uno.UI.dll and see where that leads.

@jeromelaban
Copy link
Member

I investigated this a bit more, and it seems that the Design assembly is not loaded/found/parsed by VS. I updated the original issue on community with some additional questions.

@joelsantos
Copy link

Any updates on this? I was trying Uno for the first time just now and this still happens in VS 2019 V16.5.2 and for the version 2.0.532.6 of the templates. Are there any workarounds?

@jeromelaban
Copy link
Member

None at this point, we're still looking at this with Microsoft.

@ghost
Copy link

ghost commented Apr 21, 2020

Is there ANY workaround to this? Any way we can develop using Uno without this issue?

@MatFillion
Copy link
Contributor

@LeonardoEstrela-Dev if you set the platform picker to UWP the full intelliscence will work. This issue only occurs if the dropdown is set to something other than UWP, which should rarely be necessary.

@ghost
Copy link

ghost commented Apr 21, 2020

@MatFillion thank you, that worked!

@marxxxx
Copy link

marxxxx commented Jun 12, 2020

@MatFillion Could you elaborate which platform picker you are refering to? Having the UWP Project as Startup Project automatically selects UWP as platform. But still the issue persists if i open the XAML file from the Shared Project:

image

As this is a first impression people are getting when trying out the Uno Platform i think it's this should be priorized higher in order to support adoption.

@jeromelaban
Copy link
Member

@marxxxx the picker in question is the one immediately on top of the editor section in your screenshot, which has "UnoApp2.Android". Use the UWP project there.

@marxxxx
Copy link

marxxxx commented Jun 12, 2020

@jeromelaban Got it, thank you! Did not even know this guy exists! :) That fixes the problem.

@agneszitte agneszitte added project/core-tools 🛠️ Categorizes an issue or PR as relevant to core and tools and removed kind/consumer-experience labels Sep 21, 2020
@michalss
Copy link

michalss commented Oct 5, 2020

Hi what to change to make this error go away in xaml pls ?
image

@jeromelaban
Copy link
Member

jeromelaban commented Oct 5, 2020

@michalss please see above, or https://stackoverflow.com/questions/61620422/the-type-page-does-not-support-direct-content

Stack Overflow
I create new Uno Cross-Platform App 2.2 from template. When I open Shared->MainPage.xaml in doesn't open designer in code view there is a underlined error The type 'page' does not support direct co...

@michalss
Copy link

michalss commented Oct 5, 2020

@michalss please see above, or https://stackoverflow.com/questions/61620422/the-type-page-does-not-support-direct-content

Stack Overflow**The type 'page' does not support direct content**I create new Uno Cross-Platform App 2.2 from template.
When I open Shared->MainPage.xaml in doesn't open designer in code view there is a underlined error The type 'page' does not support direct co...

Thx it worked, i had to kill editor and start it again. I hope this will be fixed soon.. :)

@mediatech15
Copy link

I followed the stack overflow and the comment threads for this issue and still cant resolve the error.

@mediatech15
Copy link

I was able to resolve it. I had to clean then relaunch the project.

@jeromelaban jeromelaban added the difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. label Feb 15, 2021
@jeromelaban
Copy link
Member

jeromelaban commented Mar 4, 2021

This issue has been fixed in VS 16.10 for iOS, Android and macOS projects: https://developercommunity.visualstudio.com/t/XAML-Intellisense-does-not-use-ContentPr/587980

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/vswin Categorizes an issue or PR as relevant to Visual Studio for Windows difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/enhancement New feature or request platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform project/core-tools 🛠️ Categorizes an issue or PR as relevant to core and tools
Projects
None yet
Development

No branches or pull requests

8 participants