Exemplo n.º 1
0
        private void onPathChanged(ValueChangedEvent <string> e)
        {
            cancellationToken?.Cancel();
            request?.Cancel();

            request = new GetWikiRequest(e.NewValue);

            Loading.Show();

            request.Success += response => Schedule(() => onSuccess(response));
            request.Failure += _ => Schedule(onFail);

            api.PerformAsync(request);
        }
Exemplo n.º 2
0
        private void onPathChanged(ValueChangedEvent <string> e)
        {
            cancellationToken?.Cancel();
            request?.Cancel();

            string[] values = e.NewValue.Split('/', 2);

            if (values.Length > 1 && LanguageExtensions.TryParseCultureCode(values[0], out var language))
            {
                request = new GetWikiRequest(values[1], language);
            }
            else
            {
                request = new GetWikiRequest(e.NewValue);
            }

            Loading.Show();

            request.Success += response => Schedule(() => onSuccess(response));
            request.Failure += _ => Schedule(onFail);

            api.PerformAsync(request);
        }