Пример #1
0
        private async void Loader()
        {
            lb_views.IsEnabled = false;
            pgRing.IsActive    = true;
            try
            {
                doc = new HtmlDocument();
                await Task.Run(() => ListThreadController.GetContent(url, ref contentHtml));

                doc.LoadHtml(contentHtml);
                helper.RemoveComment(doc);
                GetMaxPage();
                GetTitle();
                GetListThread();
                if (string.IsNullOrEmpty(mxp) == false)
                {
                    mxp = mxp.Replace("of", "/").Replace("Page", string.Empty).Replace(" ", string.Empty).Trim();
                }
                page_btn_commandbar.DataContext = mxp;
            }
            catch (Exception ex)
            {
                LogError("Lỗi mạng: \n * Kiểm tra lại kết nối, DNS \n * Có thể lỗi máy chủ. \n *********** \n Chi tiết lỗi: \n" + ex.ToString());
            }
        }
Пример #2
0
 protected override void OnNavigatingFrom(MtNavigatingCancelEventArgs e)
 {
     base.OnNavigatingFrom(e);
     if (e.NavigationMode == NavigationMode.Back)
     {
         this.NavigationCacheMode = NavigationCacheMode.Disabled;
         myWebview            = null;
         helper               = null;
         listThreadController = null;
         _instance            = null;
         GC.Collect();
     }
 }
Пример #3
0
        public ListThreadView()
        {
            this.InitializeComponent();
            CurrentPage  = 1;
            appBar.Width = ActualWidth;
            countRep     = Resource.STR_EMPTY;

            helper                = new HtmlHelper();
            appSetting            = new AppSettingModel();
            listThreadController  = new ListThreadController();
            iconcolor             = appSetting.ThemeSetting;
            new_thread.Visibility = Visibility.Collapsed;

            if (Windows.Foundation.Metadata.ApiInformation.IsPropertyPresent("Windows.UI.Xaml.FrameworkElement", "AllowFocusOnInteraction"))
            {
                page_btn_commandbar.AllowFocusOnInteraction = true;
                getIdthread.AllowFocusOnInteraction         = true;
                jumpTextBox.AllowFocusOnInteraction         = true;
            }

            _instance = this;
        }