Cybermaxs
Cybermaxs

Reputation: 24558

Is it possible to use a Xaml designer or intellisense with Xamarin.Forms?

Xamarin 3.0 introduced Xamarin.Forms, a powerful UI abstraction that allows developers to easily create user interfaces that can be shared across Android, iOS, and Windows Phone.

It seems very powerful but I'm facing a few difficulties to create UI as Xamarin.Forms comes with more than 40 controls. Without intellisense or a minimalist designer, it's fairly counter-productive to search for all properties in the official doc or by browsing c# code.

The default Xaml teamplate is like this, and it's clearly not trivial to add new controls without any help.

<?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="App1.Class1">
    <Label Text="{Binding MainText}"  VerticalOptions="Center" HorizontalOptions="Center" />
</ContentPage>

So is there any chance to have intellisense inside Xaml or to use the Xaml designer ?

Upvotes: 42

Views: 15095

Answers (9)

Brandon Minnick
Brandon Minnick

Reputation: 15340

A 3rd-Party company is developing a Xamarin.Forms Designer called UI Sleuth.

They are still in stealth-mode, but have posted a couple of demo videos:

I recommend following the Lead Architect on Twitter. This is where they are posting the latest UI Sleuth updates!

Upvotes: 1

Ben Bishop
Ben Bishop

Reputation: 1414

enter image description here

I created two videos that cover how you can use Xamarin Studio's new XAML Previewer:

Intro:

Using Design Data:

Design Data with ViewModelLocator:

An example of the code involved:

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" 
        xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
        x:Class="STLBrews.Mobile.BreweriesPage"     
        xmlns:vm="clr-namespace:STLBrews.ViewModels;assembly=STLBrews.ViewModels" 
        BindingContext="{x:Static vm:ViewModelLocator.BreweriesVM}">
    <ContentPage.Content>
        <ListView
            ItemsSource="{Binding Items}" >
            <ListView.ItemTemplate> 
                <DataTemplate>
                    <ViewCell>
                        <StackLayout Orientation="Horizontal">
                            <Image Source="{Binding LogoUrl}"/>
                            <StackLayout Orientation="Vertical" Spacing="0" VerticalOptions="Center">
                                <Label Text="{Binding Name}" FontAttributes="Bold"/>
                                <Label Text="{Binding Description}" FontSize="10"/>
                            </StackLayout>
                        </StackLayout>
                    </ViewCell>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
    </ContentPage.Content>
</ContentPage>

Upvotes: 0

SushiHangover
SushiHangover

Reputation: 74144

Xamarin Studio 6.1+ includes a XAML previewer:

enter image description here

It is not perfect, but as a "preview" release does a decent job of rendering your XAML in different resolutions on iOS and Android, including different orientations.

A registration required video: https://brax.tv/lesson/xamarin-forms-hello-xaml-previewer/

Xamarin Evolve Videos @ https://evolve.xamarin.com

(Official Evolve video at the time of this posting are not online yet)

Upvotes: 4

George Birbilis
George Birbilis

Reputation: 2930

I've just read a tweet about a Xamarin.Forms Designer being announced at Xamarin Evolve 2016 conference

In the mean time you could use the Windows Phone designer and a converter to spit out Xamarin.Forms markup, see: http://www.gui-innovations.com/Blog%20Posts/windows-phones-forms-to-xamarin-forms.html

That tool is also mentioned at together with other related tools at: https://github.com/MvvmCross/MvvmCross-Forms/wiki/XAML-Tools-for-Xamarin

Upvotes: 0

Caitlin
Caitlin

Reputation: 748

If you have Resharper 9, then intellisense works in Visual Studio, with the Xamarin.Forms Intellisense extension mentioned by Clint Landry.

Upvotes: 1

Ajay Sharma
Ajay Sharma

Reputation: 2881

Intellisense has been released in its first form, more information here:

Mobile Essentials: Productivity Tools for Mobile Developers

Upvotes: 5

ClintL
ClintL

Reputation: 1453

I have had success with Xamarin.Forms Intellisense extension in a PCL but not SAP.

enter image description here

Upvotes: 6

Gutemberg Ribeiro
Gutemberg Ribeiro

Reputation: 1533

All that is needed to implement Intellisense on VS is have the Xamarin.Forms XAML schema in a .xsd file placed in the proper folder of visual studio at the installation time. I guess the NuGet package/tasks don't have at the installation time and the access required by the OS(unless you run Visual Studio as Admin and hardcoded paths into NuGet package install tasks, which is not good idea) to do it.

I've throw this same question to Xamarin team and they replied that the Intellisense is yet to come in following updates and the designer in a future(don't know how soon, even for the alpha/beta channels of update).

Hope it helps...

Upvotes: 0

Stephane Delcroix
Stephane Delcroix

Reputation: 16232

Xamarin.Forms does not come with a graphical designer (yet ?). As for intellisense there are 2 parts:

  • referencing xaml element tagged with x:Name in code behind works in both Xamarin.Studio and VisualStudio
  • Xaml completion of elements and attributes works in Xamarin.Studio, and support for completing attributes values is coming very soon. Unfortunately, intellisense for Xaml in VisualStudio does not work for now. But the problem is well known, and solutions are investigated.

Upvotes: 18

Related Questions