XAML Intellisense?

PaulRamspergerPaulRamsperger Paul RamspergerUSMember, University

It appears there is no intellisense when editing a Xamarin.Forms XAML file or did something go wrong with my install?
If there is none, is there an XSD that could be used when editing the file in the XML Text editor?

Best Answer

«1

Answers

  • b3nb3n Benedict Rausch AUMember

    I'm having the exact same issue. There is no intellisense at all when trying to create a Xamarin.Form. Should there be designer support for this as well as selecting "View Designer" does not do anything.

  • ravensorbravensorb Shawn Anderson USMember ✭✭

    I too am having this issue -- the designer does not work and there is no Intellisense. Note: I am using Visual Studio 2013 Update 2

  • EricMaupinEricMaupin Eric Maupin USXamarin Team Xamurai

    It appears there is no intellisense when editing a Xamarin.Forms XAML file or did something go wrong with my install?

    Are you using ReSharper? There's currently a bug in ReSharper's version of IntelliSense that causes this. Note that you can disable ReSharper's IntelliSense without disabling all of it and without losing smart completion elsewhere.

    Should there be designer support for this as well as selecting "View Designer" does not do anything.

    There is no designer, this option will just have Visual Studio trying to open the .xaml file with its own WPF/WP/WinRT designer which won't work.

  • ravensorbravensorb Shawn Anderson USMember ✭✭

    Any thoughts on adding support for the designer? It would make a HUGE value add as it would allow more designers to work on the UI for mobile apps.

  • ravensorbravensorb Shawn Anderson USMember ✭✭

    I am using resharper -- what do I need to disable to get this to work?

  • PaulRamspergerPaulRamsperger Paul Ramsperger USMember, University

    I am not using Resharper. Here is the Visual Studio About information:

    Microsoft Visual Studio Professional 2013
    Version 12.0.30501.00 Update 2
    Microsoft .NET Framework
    Version 4.5.51641

    Installed Version: Professional

    LightSwitch for Visual Studio 2013 06177-004-0446025-02539
    Microsoft LightSwitch for Visual Studio 2013

    Office Developer Tools - May 2014 Update ENU 06177-004-0446025-02539
    Microsoft Office Developer Tools for Visual Studio 2013 - May 2014 Update ENU

    Team Explorer for Visual Studio 2013 06177-004-0446025-02539
    Microsoft Team Explorer for Visual Studio 2013

    Visual Basic 2013 06177-004-0446025-02539
    Microsoft Visual Basic 2013

    Visual C# 2013 06177-004-0446025-02539
    Microsoft Visual C# 2013

    Visual C++ 2013 06177-004-0446025-02539
    Microsoft Visual C++ 2013

    Visual F# 2013 06177-004-0446025-02539
    Microsoft Visual F# 2013

    Visual Studio 2013 Code Analysis Spell Checker 06177-004-0446025-02539
    Microsoft® Visual Studio® 2013 Code Analysis Spell Checker
    Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.
    The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.

    Windows Phone SDK 8.0 - ENU 06177-004-0446025-02539
    Windows Phone SDK 8.0 - ENU

    ASP.NET and Web Tools 2013.2.50425
    Microsoft Web Developer Tools contains the following components:
    Support for creating and opening ASP.NET web projects
    Browser Link: A communication channel between Visual Studio and browsers
    Editor extensions for HTML, CSS, and JavaScript
    Page Inspector: Inspection tool for ASP.NET web projects
    Scaffolding: A framework for building and running code generators
    Server Explorer extensions for Windows Azure Web Sites
    Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Windows Azure

    ASP.NET Web Frameworks and Tools 2012.2 4.1.21001.0
    For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

    ASP.NET Web Frameworks and Tools 2013 5.1.20409.0
    For additional information, visit http://www.asp.net/

    Common Azure Tools 1.1
    Provides common services for use by Azure Mobile Services and Windows Azure Tools.

    File Nesting 1.0
    Automatically nest files based on file name and enables developers to nest and unnest any file manually

    Microsoft Team Foundation Server 2013 Power Tools 12.0
    Power Tools that extend the Team Foundation Server integration with Visual Studio.

    Microsoft Visual Studio Process Editor 1.0
    Process Editor for Microsoft Visual Studio Team Foundation Server

    NuGet Package Manager 2.8.50313.46
    NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

    PreEmptive Analytics Visualizer 1.2
    Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

    SQL Server Data Tools 12.0.30919.1
    Microsoft SQL Server Data Tools

    Web Essentials 2013 1.0
    Adds many useful features to Visual Studio for web developers.

    Windows Azure Mobile Services Tools 1.1
    Windows Azure Mobile Services Tools

    Windows Phone 8.1 SDK Integration 1.0
    This package integrates the tools for the Windows Phone 8.1 SDK into the menus and controls of Visual Studio.

    Workflow Manager Tools 1.0 1.0
    This package contains the necessary Visual Studio integration components for Workflow Manager.

    Xamarin 3.0.54.0 (d3cf238e3845e930e312b6ec9b4c6c5437c33067)
    Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android

    Xamarin.Android 4.12.4.20 (b5dc5ce91305e19de51d71a1122c109719c4bc34)
    Visual Studio plugin to enable development for Xamarin.Android.

    Xamarin.iOS 3.0.54.0 (d3cf238e3845e930e312b6ec9b4c6c5437c33067)
    Visual Studio extension to enable development for Xamarin.iOS

    XtraReports package 1.0
    XtraReports package

  • EricMaupinEricMaupin Eric Maupin USXamarin Team Xamurai

    I am using resharper -- what do I need to disable to get this to work?

    ReSharper's IntelliSense should be enough. ReSharper -> Options -> IntelliSense -> General -> Select Visual Studio.

  • ravensorbravensorb Shawn Anderson USMember ✭✭

    Tried that -- no luck (Even restarted VS)

  • RyanHatfieldOldRyanHatfieldOld Ryan Hatfield USMember, Insider ✭✭✭

    I'm running visual studio pro, update 2 and I have no plugins other than xamarin installed. Any other things I could try to get intellisense to work?

  • b3nb3n Benedict Rausch AUMember

    I've completely disabled resharper but I'm still not getting any intellisense:

  • AnthonyRamirezAnthonyRamirez Anthony Ramirez USUniversity ✭✭✭
    edited May 2014

    Same here...For now I switched to Xamarin Studio and Intelli-Sense works there.

    SUPER PUMPED about Xamarin.Forms though :)

  • ravensorbravensorb Shawn Anderson USMember ✭✭

    Same issue here -- completely turned off Resharper and still not working.

  • AndrewArnottAndrewArnott Andrew Arnott USMember ✭✭
    edited June 2014

    XAML Intellisense has a chance of working if you can open the .xaml file using the Xaml UI Designer editor. When I try to Open With on the .xaml file to select that, I get this error: "The file cannot be opened with the selected editor. Please choose another editor."

    This works fine for opening a Xamarin Forms XAML page if the file is defined in another kind of project (say, a WPF project). It seems that Portable Class Libraries is deliberately denying the ability to use that editor. Note that I'm not expecting the designer to work. But opening any xaml file using that editor tends to make the code editing half of the designer work, including Intellisense. So use linked files to add these xml files to another type of project (say... a WPF project for example) and you can open them in the right editor and you're halfway there.

    Once the editor can be opened, there's another step required for it to work (from my experience getting XAML Intellisense to work on other object models, anyway). You need to help the editor find the types represented by the tags. Some great documentation on this is available on MSDN. First let's look at the XAML produced by the Xamarin Forms' "Forms XAML Page" item template:

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
                           xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                           x:Class="Dart.MyFormXaml">
        <Label Text="{Binding MainText}" VerticalOptions="Center" HorizontalOptions="Center" />
    </ContentPage>
    

    Notice the root tag has a namespace that is just a URI -- not "clr-namespace" bit. That's fine, but it means some other magic is required to associate the namespace with the assembly that the types come from. For this to work in the designer's code pane, this association comes from the assembly carrying the types. Specifically, the Xamarin.Forms.Core.dll assembly needs to define this attribute:

    [assembly: XmlnsDefinition("http://xamarin.com/schemas/2014/forms", "Xamarin.Forms")]
    

    That attribute is regrettably missing from the assembly, so getting Intellisense to work while the xmlns attribute is the way it is in the item template (I think) is impossible.

    You can preview some of what Intellisense will be like after this work is done (on Xamarin's side) by creating such a .xaml file inside a WPF project, adding the Xamarin.Forms NuGet package to it, and then opening it inside the XAML editor. Change the opening tag to read this:

    <ContentPage xmlns="clr-namespace:Xamarin.Forms;assembly=Xamarin.Forms.Core"
                       xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                       x:Class="Dart.MyFormXaml">
    

    Notice how I've changed the value of the xmlns attribute. This now tells XAML exactly where to find the ContentPage type, and so Intellisense now works in VS. But since I've changed the xmlns attribute, I expect (although I've not yet tried it) that this may cause deserialization to fail at runtime.

  • EricMaupinEricMaupin Eric Maupin USXamarin Team Xamurai

    Specifically, the Xamarin.Forms.Core.dll assembly needs to define this attribute:

    Given that the Core assembly is PCL and that attribute is defined in System.Xaml.dll, that's a no go. The only way that would work is if the consuming side did a string comparison instead of a type and we could define our own version of the attribute.

  • LauroOliveiraLauroOliveira Lauro Oliveira BRMember

    The IntelliSense works in Xamarin Studio, how to get it working on Visual Studio 2013?
    Any one get it working?

  • PaulRamspergerPaulRamsperger Paul Ramsperger USMember, University

    Guess I'll use Xamarin Studio for XAML development until they figure out how to get things working in Visual Studio.
    If things actually work well (binding and performance in particular), I can't describe how excited I am to be able to write XAML for shared UIs.

  • b3nb3n Benedict Rausch AUMember

    Any update on this? Has anyone got XAML intellisense working in VS2013?

  • DiptimayaPatraDiptimayaPatra Diptimaya Patra USMember ✭✭

    Xamarin Studio Intellisense doesn't work and it gives error as soon as I start typing "<" for tag starting.
    Not using Resharper.

    Any suggestions?

  • DavidM.5773DavidM.5773 David M USMember

    Intellisense not working. Wish it did. No resharper, fresh install of Xamarin on top of VS2013 update 2.

  • MichaelCookMichaelCook Michael Cook USMember

    I'm going to add a +1 to this. It makes XAML a pretty frustrating experience when there is no IDE support other than color coding. I am using ReSharper, but disabling it doesn't help.

    ReSharper also has some issues with the code behind files.

  • saramgsilvasaramgsilva Sara Silva PTInsider, University, Developer Group Leader ✭✭

    +1! Tomorrow I have a talk about Xamarin, but will not show so much about XAML because is complicate write XAML without intellicense. And Xamarin Studio only show me Android apps :( and the experience is completly differente.... I prefer VS and Code behide

  • LauraGrossoLauraGrosso Laura Grosso ITMember, University

    +1
    Presently we have this situation:

    • VS 2013: Android + iOS + WPhone projects, but no intellisense for XAML
    • Xamarin Studio: intellisense for XAML, but no iOS or WPhone projects.
  • NayZaKNayZaK Ian USMember ✭✭

    I'm using Xamarin Studio 5.2 (build 379). From previous update in alpha channel XAML autocomplete has broken. It behaves like in simple XML document. No properties autocomplete and no enums autocomplete. Is it a known bug?

  • MihaMarkicMihaMarkic Miha Markic SI ✭✭✭✭

    Another wish for XAML Intellisense. Much more important (and probably easier to achive) than Designer.

  • CraigDunnCraigDunn Craig Dunn USXamarin Team Xamurai

    UserVoice is the place to 'vote' on feature requests - they'll get counted up and summarized for us so we know what to aim for next.

  • SMouligneauxSMouligneaux Sébastien MOULIGNEAUX USUniversity ✭✭
  • RiccardoMoschettiItalyRiccardoMoschettiItaly riccardo moschetti USMember

    @SMouligneaux‌ I gave my votes! Good idea.

  • NayZaKNayZaK Ian USMember ✭✭

    Xamarin Studio 5.2 build 384 still have autocomplete issue in xaml. Is this problem just for me?

  • CorradoCavalliCorradoCavalli Corrado Cavalli ITInsider, University ✭✭

    Adding myself to the list of user asking for Xaml intellisense in Forms.

  • LazyLizzardLazyLizzard Niel Pieters ZAMember

    Same here, +1 for intellisense at least...

  • OlivierMatisOlivierMatis Olivier Matis BEUniversity

    +1. Xamarin Forms are really amazing, but without XAML intellisense, it spoils the party

  • ChaseFlorellChaseFlorell Chase Florell CAInsider, University mod

    Please don't +1 this thread. Instead, if you really want to give your vote, head over to the UserVoice that already has this issue.

    https://xamarin.uservoice.com/forums/258559-xamarin-forms-suggestions/suggestions/6187329-xaml-intellisense

  • NayZaKNayZaK Ian USMember ✭✭

    Xamarin Studio 5.2 release still broken autocomplete in XAML :(

  • MichaelStevensMichaelStevens Michael Stevens ESMember

    It's hard write code XALM without intellisense. Please Xamarin team fix it, it's essential for programmers.

  • CharlesKEAT.4951CharlesKEAT.4951 Charles KEAT USMember

    We are currently qualifying Xamarin for our mobile business strategy and, as of now, even if we understand the potential power of this approach ("one X-Platform design to rule them all"), we have found critical drawbacks (No auto-completion, no online reference documentation with a clear list of attributes like http://developer.android.com/reference/android/widget/TextView.html, ...) that restrain us from using of Xamarin.Forms.

  • CraigDunnCraigDunn Craig Dunn USXamarin Team Xamurai

    @CharlesKEAT.4951‌ there is API documentation, such as this Entry members page.

    We are aware that people really want auto-complete for Xaml in Visual Studio; and we're also working hard to continually expand the documentation at developer.xamarin.com.

  • KevinFordKevinFord Kevin Ford USUniversity, Certified XTC Partners ✭✭✭

    The xaml editor in the code view is just a xml editor so you don't really get intellisense but with the right schema it would sure act like it . If Xamarin provided us with the schema for http://xamarin.com/schemas/2014/forms we could just follow the instructions on the blog post below and fix it the same way we fixed the Visual Studio Android XML editor (This link talks about VS 2012 but it worked fine for me in 2013):

    http://stackoverflow.com/questions/17245308/xamarin-android-intellisense-not-working-in-visual-studio-2010

    With the correct xsd file for http://xamarin.com/schemas/2014/forms this should work nicely for us in Visual Studio. Well for the standard Xamarin.Forms Xaml controls at least.

«1
Sign In or Register to comment.