Example #1
0
        private async void OnQueryData(object sender, EventArgs e)
        {
            CharacterProfileData data;

            try
            {
                loadingIndicator.IsRunning = true;
                //Load Character Details
                data = await _viewmodel.LoadMainCharacterDataAsync(RealmInfo.Text, CharName.Text);
            }
            finally
            {
                loadingIndicator.IsRunning = false;
            }

            if (data == null)
            {
                //early return based on bad data
                await DisplayAlert("Error", "Invalid credentials provided, please re-enter and try again", "OK");

                return;
            }

            var page = new CharacterMainView();
            var vm   = new CharacterMainViewModel(data);

            page.BindingContext = vm;

            this.Navigation.PushAsync(page);
        }
Example #2
0
        private async void OnQueryData(object sender, EventArgs e)
        {
            CharacterProfileData data;
            try
            {
                loadingIndicator.IsRunning = true;
                //Load Character Details
                data = await _viewmodel.LoadMainCharacterDataAsync(RealmInfo.Text,CharName.Text);

            }
            finally
            {
                loadingIndicator.IsRunning = false;
            }

            if(data == null)
            {
                //early return based on bad data
                await DisplayAlert("Error","Invalid credentials provided, please re-enter and try again", "OK");
                return;
            }

            var page = new CharacterMainView();
            var vm = new CharacterMainViewModel(data);
            page.BindingContext = vm;

            this.Navigation.PushAsync(page);
        }