Forum Xamarin.Forms

auto call a method without pressing a button

Pat99Pat99 USMember ✭✭

Is there any way that i can auto call the following without getGamesButton?

var getGamesButton = new Button{ Text = "Get Games" };

            getGamesButton.Clicked += async (sender, e) => {
                var webService = new GameRepository ();
                var webServiceCall = await webService.GetGamesAsync ();
                Lv.ItemsSource= webServiceCall;
                Xamarin.Forms.Device.BeginInvokeOnMainThread (()=>{
                    Console.WriteLine ("found size" + webServiceCall.Count);

Best Answers


Sign In or Register to comment.