Problem with my First XF Nuget Package

  • Thread starter Thread starter Jassim Rahma
  • Start date Start date
J

Jassim Rahma

Guest
Hi,

I am trying to create a Nuget package to be used for my Xamarin Forms apps.

I am just starting a simple package to DisplayAlert like this:


private void Button_Clicked(object sender, EventArgs e)
{
OneID.Signin.Log("Hello");
}

but I am getting:

System.NullReferenceException: 'Object reference not set to an instance of an object.'

My Nuget is created as a .NET Stranded Library Class, then I added a Signin Class file like this:


using System;
using System.Collections.Generic;
using System.Text;
using Xamarin.Forms;

namespace OneID
{
public class Signin
{
private static Page page;

public static void Log(string text)
{
page.DisplayAlert("Test", "Ok", "Yes");
}
}
}



so Why I am getting the NullReferenceException error?


Thanks,
Jassim

Continue reading...
 
Back
Top