New Xamarin.Forms XAML IntelliSense in Visual Studio for Mac
Visual Studio 2019 for Mac version 8.2 is officially available as a preview. Now featuring significant improvements to the XAML editing experience for Xamarin developers. The Xamarin.Forms XAML editing experience on Mac is now powered by the same engine that drives WPF, UWP, and Xamarin.Forms IntelliSense on Windows. This brings several enhancements to Xamarin.Forms developers. Enhancements such as improved matching, binding/commanding IntelliSense, and light bulb suggestions. Additionally, code navigation, linting, resource completion, and markup extension completion also underwent ameliorations.
XAML IntelliSense Experience
Improvements to the XAML editing experience were driven by your feedback in numerous surveys and one-on-one interviews. Thank you for continuing to provide our team feedback and shape the future of Xamarin integration in Visual Studio. Keep it coming!
In this blog post, we will look at some of the specific improvements to the XAML editing experience.
As you type, the IntelliSense engine provides suggestions. Unfortunately, if you mistype, or if there are lots of suggestions provided, it can be difficult to find exactly what you need. This release improves the matching around control and property names to ensure you receive the correct suggestion:
- Fuzzy Matching: The current matching algorithm only looks for exact string matches. Even a minor mistyping can result in no suggestions. The new algorithm will provide matches, even if you mistype. Example:
Stckprovides a suggestion for
- Substring Matching: This matching is ideal for scenarios where you know part of the control name, but not the exact name. It’s also useful if you’re looking for groupings of controls. Example: Layout provides suggestions for
- CamelCase Matching: Shortcuts are provided for CamelCase types. Example:
SLprovides a suggestion for
Binding Context IntelliSense
When your binding context is set in XAML (as opposed to the constructor of the code behind), Visual Studio will make suggestions for data binding or commanding:
Light Bulb Suggestions
Now, Visual Studio offers light bulb suggestions for things like missing XML namespace imports:
Edited resources defined in the page will be available to the IntelliSense service to provide suggestions:
Markup Extension IntelliSense
Markup extensions, such as Binding, StaticResource, or x:Static, will now appear after opening a curly brace:
XML Namespace IntelliSense
Additionally, Visual Studio will also provide suggestions when editing an XML namespace:
Share your feedback!
To make sure XAML IntelliSense for Xamarin.Forms inside of VS2019 for Mac is everything you hope for, we need your help! Let us know if you experience problems with any functionality detailed above, or if you have expectations that aren’t being met. Do this by using the reporting feature in the IDE, which can be found under Help > Report a Problem.
With your feedback, please provide a sample XAML file, video, and/or reproduction steps, if possible. Thank you for help making improvements to Xamarin tooling in Visual Studio and Visual Studio for Mac!