Starting with Xamarin

1

I was interested in xamarin and decided to test it a short time, the problem is that all the tutorials I saw have the option "portable", and in visual studio 2017 does not have, even for android as for cross plataform (I do not have mac ).

When I open a "Blank App (Android)" it opens different from other tutorials, for example:

My code:

    namespace App14
{
    [Activity(Label = "App14", MainLauncher = true)]
    public class MainActivity : Activity
    {
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
        }
    }
}

    namespace App14
{
    [Activity(Label = "App14", MainLauncher = true, Icon = "@drawable/icon")]
    public class MainActivity : Activity
    {
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            Button button = FindViewButtonId<Button>(Resource.Id.MyButton);

            Button.Click +- delegate { button.Text = string.Format("{0} clicks!", count++ ")}

        }
    }
}

And with that I get lost, I did not find any tutorial updated or explanatory

    
asked by anonymous 10.01.2018 / 13:12

1 answer

0

The path to creating PCL projects is a bit different in newer versions of visual studio. Go to File > New Project > Cross-Platform > Cross-Platform App (Xamarin.Forms). In the code sharing strategy or Code Sharing Strategy select ".NET Standard". Once this is done, VS will create a PCL project.

    
10.01.2018 / 16:34