System.Threading namespace is not working/appearing

Munem Maruf 1 Reputation point
2020-01-20T10:57:52.813+00:00

I am developing a novice level test xamarin test project since I am new to this technology. I need to add a static variable of type Timer using the System.Threading namespace as follows,

private static Timer timer;

But, it doesn't seem to work. I did the following things to try to make it work.

  • added the nuget package manager manually
  • In reference, .NET --> right click View in object browser --> select System.Threading --> clicked add reference to the selected project

*Unfortunately the website is not uploading the screenshots

Universal Windows Platform (UWP)
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Roy Li - MSFT 32,051 Reputation points Microsoft Vendor
    2020-01-21T06:47:04.813+00:00

    Hello,

    Welcome to Microsoft Q&A!

    Xamarin Forms project contains System.Threading namespace. You just add the following in .cs file and please avoid adding the System.Threading with reference browser.

    using System.Threading;  
        using System.Threading.Tasks;  
        using Xamarin.Forms;  
          
        namespace App58  
        {  
              
            public partial class MainPage : ContentPage  
            {  
                public MainPage()  
                {  
                    InitializeComponent();  
                      
                }  
                private static Timer timer;  
            }  
        }  
    
    1 person found this answer helpful.
    0 comments No comments