Exemplo n.º 1
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_main);

            BottomNavigationView navigation = FindViewById <BottomNavigationView>(Resource.Id.navigation);

            navigation.SetOnNavigationItemSelectedListener(this);

            if (_tableAdapter != null)
            {
                return;
            }

            SetupTable(new List <TestResult>());

            var contacts    = 1000;
            var repeatTests = 10;
            var now         = DateTime.Now;
            var scheduler   = new TestScheduler();
            var result      = await scheduler.ExecuteTestsAsync(contacts, repeatTests);

            _tableAdapter.AddAll(ResultViewModel.From(result));

            var delta        = DateTime.Now - now;
            var resultString = $"Processing time (s): { delta.TotalSeconds.ToString("0.0") }";

            Toast.MakeText(this, resultString, ToastLength.Short).Show();
        }