How to open the MainPage.axml from a Xamarin Project in Designer mode?

4

So recently I downloaded Visual Studio 2017 and came across the Multiplatform Application (Xamarim.Forms or Native), when I create it it is generated 4 projects. The App1; App1.Droid; App1.IOS; App1.UWP (Universal Windows Plataform) .

I do not quite understand Xamarin, but I imagine that what I do in the App1 project will be compiled for all other platforms, however I would like to open MainPage.axml and App.axml in designer mode so that I can visually edit, but I can only do this with the MainPage.axml and App.axml of the project for UWP. I would like to know how to open the main project files.

    
asked by anonymous 23.05.2017 / 05:39

2 answers

3

App.xaml ("design") e App.cs (code behind) is just a file say 'start' in Xamarin-Forms projects.

The file ( App.xaml ) does not contain (directly) anything related to the part of UI , I say directly because it can contain design style settings, font color for example, etc. In short this view does not have the function of interacting with the user.

One of the functions of the file ( App.cs ) is to define the application home page, among others, for more details see: App Class

Design mode still does not exist which makes development tiresome since to check change in the UI it is necessary to run application, however, I know two tools that make this task less painful:

  • Xamarin.Forms Previewer Option View > Other Windows > Xamarin.Forms Previewer
  • Gorilla Player I find it more complete because it has better support in recognizing Xaml . It's more complicated to configure (need install apk) but it's worth it. Download VS 2017 Version

  • Sources:
    link link p>     

    23.05.2017 / 15:08
    3

    Responding to your question / quote:

    Yes, in short, in Xamarin.Forms you write the layout (View) of your screens and the application logic only once (in your case within App1) and the native layout for the other platforms is generated (compiled ) automatically. You can also individually change the layout and modify the individual behavior of each platform if you want something more specific.

    Now let's answer your question:

    There is no Designer available yet for XAML Forms XAML pages. You must do everything in the "hand". To see the result you must run the application on the desired emulator or on your mobile.

    This information can be found on XAML's Xamarin.Forms basics page: Xamarin. Forms XAML

    Translating what is written there:

      

    There is not yet a visual editor for XAML generated in Xamarin.Forms applications, so all XAML should be handwritten.

        
    23.05.2017 / 13:41