Esempio n. 1
0
 private void GoToPage(Data.ThreadPageDataSource item)
 {
     if (item != this.viewmodel.SelectedItem)
     {
         this.viewmodel.SelectedItem = item;
     }
 }
        private void OnPageItemChanged(object item)
        {
            if (item == null)
            {
                return;
            }

            else if (!(item is Data.ThreadPageDataSource))
            {
                throw new Exception("Item must be of type Data.ThreadPageDataSource!");
            }

            else
            {
                this.PageManager.ClearHtml();
                PageData = AttachPageData(item as Data.ThreadPageDataSource);
                if (string.IsNullOrEmpty(PageData.Html))
                {
                    this.IsLoading = true;
                    PageData.Refresh();
                }

                else if (PageManager.IsReady)
                {
                    this.ThreadPageLoadingBar.Opacity = 0;
                    PageManager.LoadHtml(PageData.Html);
                }
            }
        }
		private void OnPageItemChanged(object item)
		{
            	if (item == null)
                	return;

            	else if (!(item is Data.ThreadPageDataSource))
                	throw new Exception("Item must be of type Data.ThreadPageDataSource!");

            	else
            	{
                    this.PageManager.ClearHtml();
                	PageData = AttachPageData(item as Data.ThreadPageDataSource);
                    if (string.IsNullOrEmpty(PageData.Html))
                    {
                        this.IsLoading = true;
                        PageData.Refresh();
                    }

                    else if (PageManager.IsReady)
                    {
                        this.ThreadPageLoadingBar.Opacity = 0;
                        PageManager.LoadHtml(PageData.Html);
                    }
            	}
			
		}
Esempio n. 4
0
 public ThreadViewPageState(Data.ThreadDataSource thread, Data.ThreadPageDataSource page)
 {
     ThreadID   = thread.ThreadID;
     Title      = thread.Title;
     PageCount  = thread.PageCount;
     Html       = page.Html;
     Posts      = page.Posts;
     PageNumber = page.PageNumber;
 }
        private Data.ThreadPageDataSource AttachPageData(Data.ThreadPageDataSource data)
        {
            if (PageData != null)
            {
                PageData.ThreadPageUpdated  += OnThreadPageUpdated;
                PageData.ThreadPageUpdating += OnThreadPageUpdating;
            }

            data.ThreadPageUpdated  += OnThreadPageUpdated;
            data.ThreadPageUpdating += OnThreadPageUpdating;
            return(data);
        }