示例#1
0
        public bool HandleUrl(string url)
        {
            var contentList = ((ContentListPageViewModel)BindingContext).ContentList;
            var index       = contentList.FindIndex(content => content.Source.Equals(url));

            if (index == -1)
            {
                return(false);
            }
            var item = ContentListView.GetItem(index);

            ContentSelected(item);
            return(true);
        }
        public bool HandleUrl(string url)
        {
            var contentListPageViewModel = (ContentListPageViewModel)BindingContext;
            var contentList = contentListPageViewModel.ContentList;
            var index       = contentList.FindIndex(content => content.Source.Equals(url));

            if (index == -1)
            {
                return(false);
            }
            contentListPageViewModel.IsBusy = true;
            var item = ContentListView.GetItem(index);

            ContentListView.SetFocusedContent(item).ContinueWith(async _ =>
            {
                await UpdateContentInfo();
                await ContentSelected(ContentListView.FocusedContent);
                contentListPageViewModel.IsBusy = false;
            }, TaskScheduler.FromCurrentSynchronizationContext());

            return(true);
        }