Beispiel #1
0
		public static async Task<Tsc2046> GetDefaultAsync()
		{
			if (_DefaultInstance == null)
			{
				_DefaultInstance = new Tsc2046();
				_initTask = _DefaultInstance.InitTSC2046SPI();
			}
			await _initTask.ConfigureAwait(false);
			return _DefaultInstance;
		}
Beispiel #2
0
        public static async Task <Tsc2046> GetDefaultAsync()
        {
            if (_DefaultInstance == null)
            {
                _DefaultInstance = new Tsc2046();
                _initTask        = _DefaultInstance.InitTSC2046SPI();
            }
            await _initTask.ConfigureAwait(true);

            return(_DefaultInstance);
        }
Beispiel #3
0
 private async void InitTouch()
 {
     tsc2046 = await TouchPanels.Devices.Tsc2046.GetDefaultAsync();
     try
     {
         await tsc2046.LoadCalibrationAsync(CalibrationFilename);
     }
     catch (System.IO.FileNotFoundException)
     {
         await CalibrateTouch(); //Initiate calibration if we don't have a calibration on file
     }
     catch (System.UnauthorizedAccessException)
     {
         //No access to documents folder
         await new Windows.UI.Popups.MessageDialog("Make sure the application manifest specifies access to the documents folder and declares the file type association for the calibration file.", "Configuration Error").ShowAsync();
         throw;
     }
     //Load up the touch processor and listen for touch events
     processor = new TouchPanels.TouchProcessor(tsc2046);
     processor.PointerDown += Processor_PointerDown;
     processor.PointerMoved += Processor_PointerMoved;
     processor.PointerUp += Processor_PointerUp;
 }