public void ShowDialogUsingDispatcher()
 {
     MainThreadDispatcher.RunOnMainThread(() =>
     {
         _displayer.ShowDialog("This runs on the main thread because of the dispatcher");
     });
 }
Exemplo n.º 2
0
 private void ShowDialogUsingDispatcher()
 {
     MainThreadDispatcher.RunOnMainThread(() =>
     {
         var alertView = new UIAlertView("This runs on the UI thread!", "", null, "Ok", null);
         alertView.Show();
     });
 }
Exemplo n.º 3
0
        private void ShowDialogUsingDispatcher()
        {
            MainThreadDispatcher.RunOnMainThread(() =>
            {
                var builder = new AlertDialog.Builder(this)
                              .SetMessage("This runs on the UI thread!")
                              .SetPositiveButton("Ok", (s, e) => { });

                builder.Show();
            });
        }
    void OnTriggerDownEvent()
    {
        MainThreadDispatcher.RunOnMainThread(() =>
        {
            if (isCalibrating)
            {
                if (gotFirstPoint)
                {
                    secondPoint[currentCalibrationAxis] = lastRawCursorPosition;
                    FinishAxisCalibration();
                    gotFirstPoint = false;
                }
                else
                {
                    firstPoint[currentCalibrationAxis] = lastRawCursorPosition;
                    gotFirstPoint = true;

                    if (currentCalibrationAxis == 0)
                    {
                        XAxisFirstObject.SetActive(false);
                        XAxisSecondObject.SetActive(true);
                    }
                    else if (currentCalibrationAxis == 1)
                    {
                        YAxisFirstObject.SetActive(false);
                        YAxisSecondObject.SetActive(true);
                    }
                    else
                    {
                        ZAxisFirstObject.SetActive(false);
                        ZAxisSecondObject.SetActive(true);
                    }
                }
            }
        });
    }