Exemplo n.º 1
0
        private void DrawControl(bool callEvent)
        {
            labelCurrentPageNo.Text    = PageIndex.ToString();
            labelTotalPageNo.Text      = PageCount.ToString();
            labelTotalRecordCount.Text = RecordCount.ToString();
            textBoxPageSize.Text       = _pageSize.ToString();

            if (callEvent && OnPageChanged != null)
            {
                OnPageChanged(this, null);//当前分页数字改变时,触发委托事件
            }
            SetFormCtrEnabled();
            if (PageCount == 1)//有且仅有一页
            {
                linkLabelFirst.Enabled = false;
                linkLabelPrev.Enabled  = false;
                linkLabelNext.Enabled  = false;
                linkLabelLast.Enabled  = false;
                //pictureBoxGo.Enabled = false;
            }
            else if (PageIndex == 1)//第一页
            {
                linkLabelFirst.Enabled = false;
                linkLabelPrev.Enabled  = false;
            }
            else if (PageIndex == PageCount)//最后一页
            {
                linkLabelNext.Enabled = false;
                linkLabelLast.Enabled = false;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 页面控件呈现
        /// </summary>
        private void DrawControl(bool callEvent)
        {
            lblCurrentPage.Text = PageIndex.ToString();
            lblPageCount.Text   = PageCount.ToString();
            lblTotalCount.Text  = RecordCount.ToString();
            txtPageSize.Text    = PageSize.ToString();

            if (callEvent)
            {
                OnPageChanged?.Invoke(this, new PageControlEvemtArgs(this.PageSize, this.pageIndex));//当前分页数字改变时,触发委托事件
            }
            SetFormCtrEnabled();
            if (PageCount == 1)//有且仅有一页
            {
                lnkFirst.Enabled = false;
                lnkPrev.Enabled  = false;
                lnkNext.Enabled  = false;
                lnkLast.Enabled  = false;
            }
            else if (PageIndex == 1) //第一页
            {
                lnkFirst.Enabled = false;
                lnkPrev.Enabled  = false;
            }
            else if (PageIndex == PageCount) //最后一页
            {
                lnkNext.Enabled = false;
                lnkLast.Enabled = false;
            }
        }
Exemplo n.º 3
0
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        int pId1 = 1;

        int.TryParse(txtPn.Text.Trim(), out pId1);
        PageIndex = pId1;

        if (PageIndex > PageCount)
        {
            PageIndex = PageCount;
        }
        if (PageIndex < 1)
        {
            PageIndex = 1;
        }

        string     btn111 = "btn" + (Convert.ToString((PageIndex) % 6) == "0" ? "6" : Convert.ToString((PageIndex) % 6));
        string     btn222 = "lbtn" + (Convert.ToString((PageIndex) % 6) == "0" ? "6" : Convert.ToString((PageIndex) % 6));
        LinkButton lb     = this.FindControl(btn111) as LinkButton;
        Label      lb2    = this.FindControl(btn222) as Label;

        lb2.Text      = "<span >" + PageIndex.ToString() + "</span>";
        lbtn1.Visible = false;
        lbtn2.Visible = false;
        lbtn3.Visible = false;
        lbtn4.Visible = false;
        lbtn5.Visible = false;
        lbtn6.Visible = false;
        lb.Visible    = false;
        lb2.Visible   = true;

        PageInit();
    }
Exemplo n.º 4
0
        /// <summary>
        /// 页面控件呈现
        /// </summary>
        private void DrawControl(bool callEvent)
        {
            btnGo.Text          = JumpText;
            lblCurrentPage.Text = PageIndex.ToString();
            lblPageCount.Text   = PageCount.ToString();
            lblTotalCount.Text  = RecordCount.ToString();
            txtPageSize.Text    = PageSize.ToString();

            if (callEvent && OnPageChanged != null)
            {
                OnPageChanged(this, null);//当前分页数字改变时,触发委托事件
            }
            SetFormCtrEnabled();
            if (PageCount == 1)//有且仅有一页
            {
                lnkFirst.Enabled = false;
                lnkPrev.Enabled  = false;
                lnkNext.Enabled  = false;
                lnkLast.Enabled  = false;
                btnGo.Enabled    = false;
            }
            else if (PageIndex == 1)//第一页
            {
                lnkFirst.Enabled = false;
                lnkPrev.Enabled  = false;
            }
            else if (PageIndex == PageCount)//最后一页
            {
                lnkNext.Enabled = false;
                lnkLast.Enabled = false;
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 根据不同的条件,改变页面控件的呈现状态
        /// </summary>
        private void DrawControl(bool callEvent)
        {
            currentPageLabel.Text         = PageIndex.ToString();
            pageCountLabel.Text           = PageCount.ToString();
            totalCountLabel.Text          = RecordCount.ToString();
            pageSizeComboBox.SelectedItem = PageSize.ToString();

            if (callEvent && OnPageChanged != null)
            {
                OnPageChanged(this, null);//当前分页数字改变时,触发委托事件
            }
            SetFormCtrEnabled();
            if (PageCount == 1)//有且仅有一页时
            {
                firstButton.Enabled    = false;
                previousButton.Enabled = false;
                nextButton.Enabled     = false;
                lastButton.Enabled     = false;
                goButton.Enabled       = false;
            }
            else if (PageIndex == 1)//当前页为第一页时
            {
                firstButton.Enabled    = false;
                previousButton.Enabled = false;
            }
            else if (PageIndex == PageCount)//当前页为最后一页时
            {
                nextButton.Enabled = false;
                lastButton.Enabled = false;
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// 页面控件呈现
        /// </summary>
        private void DrawControl(bool callEvent, int p)
        {
            //设置页码
            if (callEvent)
            {
                pageIndex = p;
            }

            txtCurrentPage.Text = PageIndex.ToString();
            lblState.Text       = string.Format("总共{0}条记录,当前第{1}页,共{2}页,每页{3}条记录", RecordCount, PageIndex, PageCount, PageSize);

            if (pageIndex != -1 && callEvent && OnPageChanged != null)
            {
                OnPageChanged(this, null);//当前分页数字改变时,触发委托事件
            }
            SetFormCtrEnabled();
            if (PageCount == 1)//有且仅有一页
            {
                btnFirst.Enabled = false;
                btnPrev.Enabled  = false;
                btnNext.Enabled  = false;
                btnLast.Enabled  = false;
                btnGo.Enabled    = false;
            }
            else if (PageIndex == 1)//第一页
            {
                btnFirst.Enabled = false;
                btnPrev.Enabled  = false;
            }
            else if (PageIndex == PageCount)//最后一页
            {
                btnNext.Enabled = false;
                btnLast.Enabled = false;
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// 根据不同的条件,改变页面控件的呈现状态
        /// </summary>
        private void DrawControl(bool callEvent)
        {
            lblCurrentPage.Text = PageIndex.ToString();
            lblPageCount.Text   = PageCount.ToString();
            lblTotalCount.Text  = RecordCount.ToString();
            txtPageSize.Text    = PageSize.ToString();

            if (callEvent && OnPageChanged != null)
            {
                //  MessageBox.Show("PageChanged");
                OnPageChanged(this, null);//当前分页数字改变时,触发委托事件
            }
            SetFormCtrEnabled();
            if (PageCount == 1)//有且仅有一页时
            {
                linkFirst.Enabled    = false;
                linkPrevious.Enabled = false;
                linkNext.Enabled     = false;
                linkLast.Enabled     = false;
                btnGo.Enabled        = false;
            }
            else if (PageIndex == 1)//当前页为第一页时
            {
                linkFirst.Enabled    = false;
                linkPrevious.Enabled = false;
            }
            else if (PageIndex == PageCount)//当前页为最后一页时
            {
                linkNext.Enabled = false;
                linkLast.Enabled = false;
            }
        }
Exemplo n.º 8
0
 /// <summary>
 /// 填充参数
 /// </summary>
 /// <param name="args">The args.</param>
 /// <returns></returns>
 public override Dictionary <string, string> FillArgs(Dictionary <string, string> args)
 {
     args = base.FillArgs(args);
     args["sort_type"]  = asc ? "asc" : "desc";
     args["page_index"] = PageIndex.ToString();
     args["page_size"]  = PageSize.ToString();
     return(args);
 }
Exemplo n.º 9
0
 public void BtnPageUpOnClick()
 {
     PageIndex        = (PageIndex > 1) ? PageIndex - 1 : mMaxPageCount;
     mLbPageText.text = PageIndex.ToString();
     if (e_PageIndexChange != null)
     {
         e_PageIndexChange(PageIndex);
     }
 }
Exemplo n.º 10
0
 private void ReName_Click(object sender, RoutedEventArgs e)
 {
     MainWindow.RenameIndex        = OverallIndex.ToString();
     MainWindow.RenamePage         = PageIndex.ToString();
     this.textBox1.IsReadOnly      = false;
     this.textBox1.BorderThickness = new Thickness(1);
     this.textBox1.Focus();
     this.textBox1.SelectAll();
 }
Exemplo n.º 11
0
 public void BtnPageDnOnClick()
 {
     PageIndex        = (PageIndex < mMaxPageCount) ? PageIndex + 1 : 1;
     mLbPageText.text = PageIndex.ToString();
     if (e_PageIndexChange != null)
     {
         e_PageIndexChange(PageIndex);
     }
 }
Exemplo n.º 12
0
        public string ToQueryString()
        {
            var queryString = System.Web.HttpUtility.ParseQueryString(string.Empty);

            queryString.Add(nameof(OrderBy), OrderBy.ToString());
            queryString.Add(nameof(OrderByDescending), OrderByDescending ? "true" : "false");
            queryString.Add(nameof(PageIndex), PageIndex.ToString());
            queryString.Add(nameof(PageSize), PageSize.ToString());
            queryString.Add(nameof(SearchTerm), SearchTerm);

            return(queryString.ToString());
        }
Exemplo n.º 13
0
        /// <summary>
        /// 页面控件呈现
        /// </summary>
        private void Page(bool callEvent)
        {
            if (this.toolStrip1.InvokeRequired)//等待异步
            {
                PageDelegate myDelegate = new PageDelegate(SetCtrolEnabled);

                if (this.Parent != null && !this.Parent.IsHandleCreated)
                {
                    return;
                }

                if (IsDisposed || !this.IsHandleCreated || !this.toolStrip1.IsHandleCreated)
                {
                    return;
                }

                this.Invoke(myDelegate, new object[] { false });//通过委托调用
            }
            else
            {
                if (PageIndex == 0)
                {
                    PageIndex = 1;
                }

                txt_CurrentIndex.Text = PageIndex.ToString();
                lbl_PageCount.Text    = PageCount.ToString();
                lbl_RecordCount.Text  = string.Format("每页{0}条记录,共{1}条记录", PageSize, RecordCount);

                if (callEvent && OnPageChanged != null)
                {
                    OnPageChanged(this, null);//当前分页数字改变时,触发委托事件
                }
                SetCtrolEnabled();
                if (PageCount == 1)//有且仅有一页
                {
                    btn_First.Enabled    = false;
                    btn_Last.Enabled     = false;
                    btn_Next.Enabled     = false;
                    btn_Previous.Enabled = false;
                }
                else if (PageIndex == 1)//第一页
                {
                    btn_First.Enabled    = false;
                    btn_Previous.Enabled = false;
                }
                else if (PageIndex == PageCount)//最后一页
                {
                    btn_Next.Enabled = false;
                    btn_Last.Enabled = false;
                }
            }
        }
Exemplo n.º 14
0
        /// <summary>
        /// 填充参数
        /// </summary>
        /// <param name="args">原有参数</param>
        /// <returns>填充后的参数</returns>
        public virtual Dictionary <string, string> FillArgs(Dictionary <string, string> args)
        {
            if (args == null)
            {
                args = new Dictionary <string, string>();
            }
            args["fence_id"] = FenceId.ToString();

            args["page_index"] = PageIndex.ToString();
            args["page_size"]  = PageSize.ToString();

            return(args);
        }
Exemplo n.º 15
0
        private void GetNextPage()
        {
            if (PageIndex == LastPage)
            {
                PageIndex = 1;
            }
            else
            {
                PageIndex++;
            }

            LoadData();
            Pagination = PageIndex.ToString() + "/" + LastPage.ToString();
        }
Exemplo n.º 16
0
 public JsonResult GetSucceedListResult(object list, int recordCount)
 {
     return(GetSucceedResult(new
     {
         list = list,
         RecordCount = recordCount,
         PageCount = PageCount,
         PageIndex = (recordCount > 0 ? PageIndex : 0),
         EnPageCount = DESEncrypt.Encrypt(PageCount.ToString(), DESEncrypt.Keys.SplitPage),
         EnPageIndex = DESEncrypt.Encrypt(PageIndex.ToString(), DESEncrypt.Keys.SplitPage),
         HasPrev = (PageIndex > 1),
         HasNext = (PageIndex < PageCount),
     }, ""));
 }
Exemplo n.º 17
0
        private void GetPreviousPage()
        {
            if (PageIndex == 1)
            {
                PageIndex = LastPage;
            }
            else
            {
                PageIndex--;
            }

            LoadData();
            Pagination = PageIndex.ToString() + "/" + LastPage.ToString();
        }
Exemplo n.º 18
0
 /// <summary>
 /// 设置请求前的参数
 /// </summary>
 private void SetRequestParams()
 {
     this.ClearParamters();
     this.AddParamter("key", this.KeyWord);
     this.AddParamter("p", PageIndex <= 0 ? "1" : PageIndex.ToString());
     this.AddParamter("f", "select");
     this.AddParamter("jsversion", "v5");
     this.AddParamter("listStyle", "bigPhoto");
     this.AddParamter("pri_uid", "0");
     this.AddParamter("sex", "f");
     this.AddParamter("sn", "default");
     this.AddParamter("stc", "1:4401,2:19.25,3:155.168,23:1");
     this.AddParamter("sv", "1");
 }
Exemplo n.º 19
0
        /// <summary>
        /// 填充参数
        /// </summary>
        /// <param name="args">原有参数</param>
        /// <returns>填充后的参数</returns>
        public virtual Dictionary <string, string> FillArgs(Dictionary <string, string> args)
        {
            if (args == null)
            {
                args = new Dictionary <string, string>();
            }

            args["start_time"]        = StartTime.ToUtcTicks().ToString();
            args["end_time"]          = EndTime.ToUtcTicks().ToString();
            args["coord_type_output"] = CoordTypeOutput.ToString();
            args["page_index"]        = PageIndex.ToString();
            args["page_size"]         = PageSize.ToString();
            return(args);
        }
Exemplo n.º 20
0
        private DataSet GetDataSetArticleTitle()
        {
            DataSet   dsArtileTitle = null;
            Hashtable hshParam      = new Hashtable();

            Gadget.Addparamater(ref hshParam, "AritcleTypeCode", AritcleTypeCode);
            Gadget.Addparamater(ref hshParam, "UpdatedByUserID", UpdatedByUserID);
            Gadget.Addparamater(ref hshParam, "IsAsc", IsAsc == true?"1":"0");
            Gadget.Addparamater(ref hshParam, "IsReturnAll", IsReturnAll == true?"1":"0");
            Gadget.Addparamater(ref hshParam, "PageSize", PageSize.ToString());
            Gadget.Addparamater(ref hshParam, "PageIndex", PageIndex.ToString());
            Gadget.Addparamater(ref hshParam, "SortField", SortField);
            dsArtileTitle = dbOperator.ProcessData("usp_GetArticleTitle", hshParam, strDSN);
            return(dsArtileTitle);
        }
Exemplo n.º 21
0
        /// <summary>
        /// Returns a <see cref="System.String" /> that represents this instance.
        /// </summary>
        /// <returns>
        /// A <see cref="System.String" /> that represents this instance.
        /// </returns>
        public override string ToString()
        {
            var result = new StringBuilder();

            if (PageSize != null)
            {
                SonarHelpers.AppendUrl(result, "ps", PageSize.Value.ToString());
            }
            if (PageIndex != 0)
            {
                SonarHelpers.AppendUrl(result, "p", PageIndex.ToString());
            }

            return(result.Length > 0 ? result.ToString() : string.Empty);
        }
Exemplo n.º 22
0
        /// <summary>
        /// 页面变化
        /// </summary>
        /// <param name="callEvent"></param>
        private void DoDrawControl(bool callEvent)
        {
            tPages.Text     = PageIndex.ToString();
            tPageCount.Text = PageCount.ToString();
            tCounts.Text    = RecordCount.ToString();
            if (UserData && callEvent)
            {
                LoadData();
                SetButtonEnabled();
                return;
            }
            if (callEvent && OnPageChanged != null)
            {
                OnPageChanged(this, null);//当前分页数字改变时,触发委托事件
            }

            SetButtonEnabled();
        }
Exemplo n.º 23
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         foreach (string pc in PageCover)
         {
             ListItem li = new ListItem(pc, pc);
             DDLPageSize.Items.Add(li);
             DDLPageSize.SelectedValue = "10";
         }
         HidePageIndex.Value = PageIndex.ToString();
         CreateAutoPage();
     }
     if (HidePageIndex.Value != PageIndex.ToString())
     {
         PageIndex = Convert.ToInt32(HidePageIndex.Value);
         CreateAutoPage();
     }
 }
Exemplo n.º 24
0
        public CapQuyenHoiNghiViewModel(HOINGHI HoiNghi, String type)
        {
            this.HoiNghi   = HoiNghi;
            this.LoaiAdmin = type;
            this.PageIndex = 1;

            using (DBQuanLiHoiNghiEntities db = new DBQuanLiHoiNghiEntities())
            {
                float count = db.USERs.Where(u => u.LOAIUSER.Equals("1")).Count();
                LastPage   = (int)Math.Ceiling(count / USER_PER_PAGE);
                Pagination = PageIndex.ToString() + "/" + LastPage.ToString();
            }

            this.ListCapQuyenUser = new ObservableCollection <CapQuyenUser>();
            LoadData();

            PreviousPageCommand = new RelayCommand(GetPreviousPage);
            NextPageCommand     = new RelayCommand(GetNextPage);
        }
Exemplo n.º 25
0
        /// <summary>
        /// 填充参数
        /// </summary>
        /// <param name="args">The args.</param>
        /// <returns></returns>
        public virtual Dictionary <string, string> FillArgs(Dictionary <string, string> args)
        {
            if (args == null)
            {
                args = new Dictionary <string, string>();
            }
            var filter = GetFilter();

            if (string.IsNullOrWhiteSpace(filter) == false)
            {
                args["filter"] = filter;
            }

            args["coord_type_output"] = CoordTypeOutput.ToString();
            args["page_index"]        = PageIndex.ToString();
            args["page_size"]         = PageSize.ToString();

            return(args);
        }
Exemplo n.º 26
0
        public void ProcessRequest(HttpContext context)
        {
            _site = null;
            if (SiteId != 0)
            {
                _site = new AWAPI_BusinessLibrary.library.SiteLibrary().Get(SiteId);
            }

            if (_site == null || !_site.isEnabled)
            {
                return;
            }

            _feed = new SyndicationFeed("AWAPI CMS Feed", "", null);
            _feed.Authors.Add(new SyndicationPerson(""));
            _feed.Categories.Add(new SyndicationCategory("contests"));
            _feed.AttributeExtensions.Add(new XmlQualifiedName("site"), _site.title);
            _feed.AttributeExtensions.Add(new XmlQualifiedName("sitelink"), _site.link);
            _feed.AttributeExtensions.Add(new XmlQualifiedName("defaultculture"), _site.cultureCode);
            _feed.AttributeExtensions.Add(new XmlQualifiedName("pagesize"), PageSize.ToString());
            _feed.AttributeExtensions.Add(new XmlQualifiedName("pageindex"), PageIndex.ToString());
            _feed.AttributeExtensions.Add(new XmlQualifiedName("servertime"), DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss"));
            AddParamsToFeed();

            context.Response.ContentType     = "text/xml";
            context.Response.ContentEncoding = System.Text.Encoding.UTF8;

            switch (MethodName)
            {
            case "getentrylist":
                GetEntryList(SiteId);
                break;

            case "getentrydailysummary":
                GetEntryDailySummary(SiteId);
                break;

            default:
                break;
            }

            WriteFeed();
        }
Exemplo n.º 27
0
        private void BindPagingHelperControl()
        {
            int totalPages = (TotalItemCount % PageSize) == 0 ? TotalItemCount / PageSize : TotalItemCount / PageSize + 1;

            //显示
            lbPageIndex.Text  = PageIndex.ToString();
            lbTotalPages.Text = totalPages.ToString();
            txtGoto.Text      = PageIndex.ToString();
            //使能
            lbtnFirstPage.Enabled = PageIndex > 1;
            lbtnPrevPage.Enabled  = PageIndex > 1;
            lbtnLastPage.Enabled  = PageIndex < totalPages;
            lbtnNextPage.Enabled  = PageIndex < totalPages;
            //命令
            lbtnFirstPage.CommandArgument = "1";
            lbtnPrevPage.CommandArgument  = (PageIndex - 1).ToString();
            lbtnNextPage.CommandArgument  = (PageIndex + 1).ToString();
            lbtnLastPage.CommandArgument  = totalPages.ToString();
        }
Exemplo n.º 28
0
        /// <summary>
        /// 页面控件呈现
        /// </summary>
        private void DrawControl(bool callEvent)
        {
            lblPageCount.Text = String.Format(@"/{0}",
                                              pageCount.ToString());

            if (pageCount == 0)
            {
                lblCurrentPage.Text = "0";
            }
            else
            {
                lblCurrentPage.Text = PageIndex.ToString();
            }

            lblTotalCount.Text = String.Format(_lbText, recordCount.ToString());


            //lblPageSize.Text = PageSize.ToString();

            if (callEvent && OnPageChanged != null)
            {
                OnPageChanged(this, null);//当前分页数字改变时,触发委托事件
            }
            SetFormCtrEnabled();
            if (PageCount == 1)//有且仅有一页
            {
                blnkFirst.Enabled = false;
                blnkPrev.Enabled  = false;
                blnkNext.Enabled  = false;
                blnkLast.Enabled  = false;
            }
            else if (PageIndex == 1)//第一页
            {
                blnkFirst.Enabled = false;
                blnkPrev.Enabled  = false;
            }
            else if (PageIndex == PageCount)//最后一页
            {
                blnkNext.Enabled = false;
                blnkLast.Enabled = false;
            }
        }
Exemplo n.º 29
0
 /// <summary>
 /// 验证
 /// </summary>
 public void PageChecking()
 {
     lblRecordCount.Text        = RecordCount.ToString();
     lblCurrentPageIndex.Text   = PageIndex.ToString();
     lblPageCount.Text          = TotaPage.ToString();
     default_pgStartRecord.Text = PagestartNumber.ToString();
     default_pgEndRecord.Text   = PageendNumber.ToString();
     if (TotaPage == 0 || TotaPage == 1)
     {
         hlkFirst.Enabled = false;
         hlkPrev.Enabled  = false;
         hlkNext.Enabled  = false;
         hlkLast.Enabled  = false;
         ShowMsgHelper.ShowScript("Script(1)");
     }
     else if (PageIndex == 1)
     {
         hlkFirst.Enabled = false;
         hlkPrev.Enabled  = false;
         hlkNext.Enabled  = true;
         hlkLast.Enabled  = true;
         ShowMsgHelper.ShowScript("Script(2)");
     }
     else if (PageIndex == TotaPage)
     {
         hlkFirst.Enabled = true;
         hlkPrev.Enabled  = true;
         hlkNext.Enabled  = false;
         hlkLast.Enabled  = false;
         ShowMsgHelper.ShowScript("Script(3)");
     }
     else
     {
         hlkFirst.Enabled = true;
         hlkPrev.Enabled  = true;
         hlkNext.Enabled  = true;
         hlkLast.Enabled  = true;
         ShowMsgHelper.ShowScript("Script(4)");
     }
 }
Exemplo n.º 30
0
    public void SetPageInfo()
    {
        this.LitPageResult.Text = ResultCount.ToString();
        this.TBPageIndex.Text   = PageIndex.ToString();
        if (ResultCount % PageSize == 0)
        {
            PageCount = ResultCount / PageSize;
        }
        else
        {
            PageCount = ResultCount / PageSize + 1;
        }
        //this.LBPageFirst.Enabled = true;
        //this.LBPagePrev.Enabled = true;
        //this.LBPageNext.Enabled = true;
        //this.LBPageLast.Enabled = true;
        this.pagerFirst.CssClass = "pager-ext-first";
        this.pagerPrev.CssClass  = "pager-ext-prev";
        this.pagerNext.CssClass  = "pager-ext-next";
        this.pagerLast.CssClass  = "pager-ext-last";
        if (PageIndex == 1)
        {
            //this.LBPageFirst.Enabled = false;
            //this.LBPagePrev.Enabled = false;

            // this.LBPageFirst.Attributes.Add("onclick","return false;");
            isfirst = "false";
            this.pagerFirst.CssClass = "pager-ext-first pager-ext-firstdisabled";
            this.pagerPrev.CssClass  = "pager-ext-prev pager-ext-prevdisabled";
        }
        if (PageIndex == PageCount || PageCount == 0)
        {
            //this.LBPageNext.Enabled = false;
            //this.LBPageLast.Enabled = false;
            islast = "false";
            this.pagerNext.CssClass = "pager-ext-next pager-ext-nextdisabled";
            this.pagerLast.CssClass = "pager-ext-last pager-ext-lastdisabled";
        }
    }
Exemplo n.º 31
0
        public override async void Navigate(PageIndex index, object args = null)
        {
            PageIndex originalIndex = index;
            var wasOnSearchPage = SearchToggleLock;
            SearchToggleLock = false;
            if(View.CurrentDisplayMode == SplitViewDisplayMode.CompactOverlay)
                MenuPaneState = false;
            CurrentStatusSub = "";
            IsCurrentStatusSelectable = false;
            if (!Credentials.Authenticated && PageUtils.PageRequiresAuth(index))
            {
                var msg = new MessageDialog("Log in first in order to access this page.");
                await msg.ShowAsync();
                return;
            }
            ResourceLocator.TelemetryProvider.TelemetryTrackEvent(TelemetryTrackedEvents.Navigated, index.ToString());
            ScrollToTopButtonVisibility = false;
            RefreshButtonVisibility = false;

            if (index == PageIndex.PageMangaList && args == null) // navigating from startup
                args = AnimeListPageNavigationArgs.Manga;

            if (index == PageIndex.PageSeasonal || //index is always angry btw
                index == PageIndex.PageMangaList ||
                index == PageIndex.PageTopManga ||
                index == PageIndex.PageTopAnime)
                index = PageIndex.PageAnimeList;

            MobileViewModelLocator.Hamburger.ChangeBottomStackPanelMargin(index == PageIndex.PageAnimeList || //and she likes to bit certain individual
                                                                    index == PageIndex.PageMessanging || 
                                                                    index == PageIndex.PageSearch || 
                                                                    index == PageIndex.PageWallpapers);

            if (index == PageIndex.PageAnimeList && _searchStateBeforeNavigatingToSearch != null)
            {
                SearchToggleStatus = (bool) _searchStateBeforeNavigatingToSearch;
                if (SearchToggleStatus)
                    ShowSearchStuff();
                else
                    HideSearchStuff();
            }

            ResetSearchFilter();
            switch (index) //his head specifficaly
            {
                case PageIndex.PageAnimeList:
                    if (MobileViewModelLocator.AnimeList.Initializing)
                    {
                        if (!_subscribed)
                        {
                            MobileViewModelLocator.AnimeList.Initialized += AnimeListOnInitialized;
                            _subscribed = true;
                        }
                        _postponedNavigationArgs = new Tuple<PageIndex, object>(originalIndex, args);
                        return;
                    }
                    MobileViewModelLocator.Hamburger.SetActiveButton(HamburgerButtons.AnimeList);
                    ShowSearchStuff();
                    if ((_searchStateBeforeNavigatingToSearch == null || !_searchStateBeforeNavigatingToSearch.Value) &&
                        (wasOnSearchPage || _wasOnDetailsFromSearch))
                    {
                        CurrentSearchQuery = "";
                        _wasOnDetailsFromSearch = false;
                        UnToggleSearchStuff();
                    }
                    if (CurrentMainPage == PageIndex.PageAnimeList)
                        MobileViewModelLocator.AnimeList.Init(args as AnimeListPageNavigationArgs);
                    else
                        MainNavigationRequested?.Invoke(typeof(AnimeListPage), args);
                    break;
                case PageIndex.PageAnimeDetails:
                    HideSearchStuff();
                    var detail = ViewModelLocator.AnimeDetails;
                    detail.DetailImage = null;
                    detail.LeftDetailsRow.Clear();
                    detail.RightDetailsRow.Clear();
                    RefreshButtonVisibility = true;
                    RefreshDataCommand = new RelayCommand(() => ViewModelLocator.AnimeDetails.RefreshData());
                    _wasOnDetailsFromSearch = (args as AnimeDetailsPageNavigationArgs).Source == PageIndex.PageSearch;
                    //from search , details are passed instead of being downloaded once more
                    if (CurrentMainPage == PageIndex.PageAnimeDetails)
                        ViewModelLocator.AnimeDetails.Init(args as AnimeDetailsPageNavigationArgs);
                    else
                        MainNavigationRequested?.Invoke(typeof(AnimeDetailsPage), args);
                    break;
                case PageIndex.PageSettings:
                    HideSearchStuff();
                    MainNavigationRequested?.Invoke(typeof(SettingsPage));
                    break;
                case PageIndex.PageSearch:
                case PageIndex.PageMangaSearch:
                    if(CurrentMainPage != PageIndex.PageSearch && CurrentMainPage != PageIndex.PageMangaSearch && CurrentMainPage != PageIndex.PageCharacterSearch)
                        _searchStateBeforeNavigatingToSearch = SearchToggleStatus;

                    var searchArg = args as SearchPageNavigationArgs;
                    if (string.IsNullOrWhiteSpace(searchArg.Query))
                    {
                        searchArg.Query = CurrentSearchQuery;
                    }
                    if (!searchArg.ByGenre && !searchArg.ByStudio)
                    {
                        View.SearchInputFocus(FocusState.Keyboard);
                        SearchToggleLock = true;
                        ShowSearchStuff();
                        ToggleSearchStuff();
                    }
                    else
                    {
                        HideSearchStuff();
                        CurrentStatus = searchArg.ByGenre ? "Anime by Genre" : "Anime By Studio";
                    }
                    MainNavigationRequested?.Invoke(typeof(AnimeSearchPage), args);
                    break;
                case PageIndex.PageLogIn:
                    HideSearchStuff();
                    MainNavigationRequested?.Invoke(typeof(LogInPage));
                    break;
                case PageIndex.PageProfile:
                    HideSearchStuff();
                    RefreshButtonVisibility = true;
                    if (Settings.SelectedApiType == ApiType.Mal)
                        RefreshDataCommand =
                            new RelayCommand(() => ViewModelLocator.ProfilePage.LoadProfileData(null, true));
                    else
                        RefreshDataCommand = new RelayCommand(() => ViewModelLocator.HumProfilePage.Init(true));
                    if (Settings.SelectedApiType == ApiType.Mal)
                    {
                        if (CurrentMainPage == PageIndex.PageProfile)
                            MobileViewModelLocator.ProfilePage.LoadProfileData(args as ProfilePageNavigationArgs);
                        else
                            MainNavigationRequested?.Invoke(typeof(ProfilePage), args);
                    }
                    else
                        MainNavigationRequested?.Invoke(typeof(HummingbirdProfilePage), args);
                    break;
                case PageIndex.PageRecomendations:
                    HideSearchStuff();
                    MainNavigationRequested?.Invoke(typeof(RecommendationsPage), args);
                    break;
                case PageIndex.PageCalendar:
                    HideSearchStuff();
                    CurrentStatus = "Calendar";
                    RefreshButtonVisibility = true;
                    RefreshDataCommand = new RelayCommand(() => { ViewModelLocator.CalendarPage.Init(true); });
                    MainNavigationRequested?.Invoke(typeof(CalendarPage), args);
                    break;
                case PageIndex.PageArticles:
                case PageIndex.PageNews:
                    HideSearchStuff();
                    RefreshButtonVisibility = true;
                    RefreshDataCommand = new RelayCommand(() => ViewModelLocator.MalArticles.Init(null));
                    if (CurrentMainPage == PageIndex.PageArticles)
                        ViewModelLocator.MalArticles.Init(args as MalArticlesPageNavigationArgs);
                    else
                        MainNavigationRequested?.Invoke(typeof(MalArticlesPage), args);
                    break;
                case PageIndex.PageMessanging:
                    HideSearchStuff();
                    CurrentStatus = $"{Credentials.UserName} - Messages";
                    RefreshButtonVisibility = true;
                    RefreshDataCommand = new RelayCommand(() => { ViewModelLocator.MalMessaging.Init(true); });
                    MainNavigationRequested?.Invoke(typeof(MalMessagingPage), args);
                    break;
                case PageIndex.PageMessageDetails:
                    var msgModel = args as MalMessageDetailsNavArgs;
                    RefreshButtonVisibility = true;
                    RefreshDataCommand = new RelayCommand(() => ViewModelLocator.MalMessageDetails.RefreshData());
                    CurrentOffStatus = msgModel.WorkMode == MessageDetailsWorkMode.Message
                        ? (msgModel.Arg != null
                            ? $"{(msgModel.Arg as MalMessageModel)?.Sender} - {(msgModel.Arg as MalMessageModel)?.Subject}"
                            : "New Message")
                        : $"Comments {Credentials.UserName} - {(msgModel.Arg as MalComment)?.User.Name}";
                    MainNavigationRequested?.Invoke(typeof(MalMessageDetailsPage), args);
                    break;
                case PageIndex.PageForumIndex:
                    HideSearchStuff();
                    CurrentStatus = "Forums";
                    if (args == null || (args as ForumsNavigationArgs)?.Page == ForumsPageIndex.PageIndex)
                    {
                            RefreshButtonVisibility = true;
                            RefreshDataCommand = new RelayCommand(() => { ViewModelLocator.ForumsIndex.Init(true); });
                    }
                    else
                    {
                        var navArgs = args as ForumsNavigationArgs;
                        if (navArgs?.Page == ForumsPageIndex.PageBoard)
                        {
                            RefreshButtonVisibility = true;
                            RefreshDataCommand = new RelayCommand(() => { ViewModelLocator.ForumsBoard.Reload(); });
                        }
                    }
                    if (CurrentMainPage == PageIndex.PageForumIndex)
                        ViewModelLocator.ForumsMain.Init(args as ForumsNavigationArgs);
                    else
                        MainNavigationRequested?.Invoke(typeof(ForumsMainPage), args);
                    break;
                case PageIndex.PageHistory:
                    HideSearchStuff();
                    RefreshButtonVisibility = true;
                    RefreshDataCommand = new RelayCommand(() => { ViewModelLocator.History.Init(null, true); });
                    CurrentStatus = $"History - {(args as HistoryNavigationArgs)?.Source ?? Credentials.UserName}";
                    MainNavigationRequested?.Invoke(typeof(HistoryPage), args);
                    break;
                case PageIndex.PageCharacterDetails:
                    HideSearchStuff();
                    RefreshButtonVisibility = true;
                    RefreshDataCommand = new RelayCommand(() => ViewModelLocator.CharacterDetails.RefreshData());
                    OffContentVisibility = true;

                    if (CurrentOffPage == PageIndex.PageCharacterDetails)
                        ViewModelLocator.CharacterDetails.Init(args as CharacterDetailsNavigationArgs);
                    else
                        MainNavigationRequested?.Invoke(typeof(CharacterDetailsPage), args);
                    break;
                case PageIndex.PageStaffDetails:
                    HideSearchStuff();
                    RefreshButtonVisibility = true;
                    RefreshDataCommand = new RelayCommand(() => ViewModelLocator.StaffDetails.RefreshData());
                    OffContentVisibility = true;

                    if (CurrentOffPage == PageIndex.PageStaffDetails)
                        ViewModelLocator.StaffDetails.Init(args as StaffDetailsNaviagtionArgs);
                    else
                        MainNavigationRequested?.Invoke(typeof(StaffDetailsPage), args);
                    break;
                case PageIndex.PageCharacterSearch:
                    if (CurrentMainPage != PageIndex.PageSearch && CurrentMainPage != PageIndex.PageMangaSearch && CurrentMainPage != PageIndex.PageCharacterSearch)
                        _searchStateBeforeNavigatingToSearch = SearchToggleStatus;
                    ShowSearchStuff();
                    ToggleSearchStuff();

                    SearchToggleLock = true;

                    MainNavigationRequested?.Invoke(typeof(CharacterSearchPage));
                    await Task.Delay(10);
                    View.SearchInputFocus(FocusState.Keyboard);
                    break;
                case PageIndex.PageWallpapers:
                    HideSearchStuff();
                    RefreshButtonVisibility = false;
                    MainNavigationRequested?.Invoke(typeof(WallpapersPage),args);
                    break;
                case PageIndex.PagePopularVideos:
                    HideSearchStuff();
                    CurrentStatus = "Popular Videos";
                    MainNavigationRequested?.Invoke(typeof(PopularVideosPage), args);
                    break;
                default:
                    throw new ArgumentOutOfRangeException(nameof(index), index, null);
            }
            CurrentMainPage = index;
            CurrentMainPageKind = index;
            RaisePropertyChanged(() => SearchToggleLock);


        }
Exemplo n.º 32
0
        public override async void Navigate(PageIndex index, object args = null)
        {
            PageIndex? currPage = null;
            PageIndex? currOffPage = null;
            var mainPage = true;
            var originalIndex = index;
            var wasOnSearchPage = SearchToggleLock;
            if (!Credentials.Authenticated && PageUtils.PageRequiresAuth(index))
            {
                var msg = new MessageDialog("Log in first in order to access this page."
                    ,"Login required.");
                await msg.ShowAsync();
                return;
            }
            _navigating = true;
            ResourceLocator.TelemetryProvider.TelemetryTrackEvent(TelemetryTrackedEvents.Navigated, index.ToString());
           

            DesktopViewModelLocator.Hamburger.UpdateAnimeFiltersSelectedIndex();
            //prepare for some index mess
            if (index == PageIndex.PageMangaList && args == null) // navigating from startup
                args = AnimeListPageNavigationArgs.Manga;

            if (index == PageIndex.PageAbout ||
                index == PageIndex.PageSettings ||
                index == PageIndex.PageAbout ||
                index == PageIndex.PageAnimeDetails ||
                index == PageIndex.PageMessageDetails ||
                index == PageIndex.PageCharacterDetails ||
                index == PageIndex.PageStaffDetails ||
                index == PageIndex.PageLogIn)
            {
                OffRefreshButtonVisibility = false;
                mainPage = false;
                IsCurrentStatusSelectable = false;
                currOffPage = index;
                if (index != PageIndex.PageAnimeDetails)
                {
                    ViewModelLocator.AnimeDetails.Id = 0; //reset this because we no longer are there
                    if(index != PageIndex.PageCharacterDetails && index != PageIndex.PageStaffDetails)
                        ViewModelLocator.NavMgr.ResetOffBackNav();
                }
                if(CurrentOffPage == PageIndex.PageSettings)
                    ViewModelLocator.NavMgr.ResetOffBackNav();
            }
            else //naviagating main page
            {
                ScrollToTopButtonVisibility = false;
                RefreshButtonVisibility = false;
                ResetSearchFilter();
                SearchToggleLock = false;
                CurrentHintSet = null;
            }

            switch (index)
            {
                case PageIndex.PageSeasonal:
                case PageIndex.PageMangaList:
                case PageIndex.PageTopManga:
                case PageIndex.PageTopAnime:
                case PageIndex.PageAnimeList:
                    if (index == PageIndex.PageSeasonal || index == PageIndex.PageTopAnime ||
                        index == PageIndex.PageTopManga || index == PageIndex.PageMangaList)
                        currPage = index; //used by hamburger's filters
                    else
                        currPage = PageIndex.PageAnimeList;
                    DesktopViewModelLocator.Hamburger.ChangeBottomStackPanelMargin(true);
                    index = PageIndex.PageAnimeList;
                    break;
                case PageIndex.PageSearch:
                case PageIndex.PageRecomendations:
                case PageIndex.PageProfile:
                case PageIndex.PageMangaSearch:
                case PageIndex.PageCalendar:
                case PageIndex.PageArticles:
                case PageIndex.PageNews:
                case PageIndex.PageMessanging:
                case PageIndex.PageForumIndex:
                case PageIndex.PageHistory:
                case PageIndex.PageCharacterSearch:
                case PageIndex.PageWallpapers:
                case PageIndex.PagePopularVideos:

                    if (index == PageIndex.PageSearch || index == PageIndex.PageMangaSearch ||
                        ((index == PageIndex.PageSearch || index == PageIndex.PageMangaSearch) &&
                         CurrentOffPage == PageIndex.PageSearch))
                    {
                        var arg = args as SearchPageNavigationArgs;
                        if (Settings.ForceSearchIntoOffPage || CurrentMainPage == PageIndex.PageForumIndex ||
                            CurrentMainPage == PageIndex.PageProfile || CurrentOffPage == PageIndex.PageSearch)
                        {
                            arg.DisplayMode = SearchPageDisplayModes.Off;
                            args = arg;
                        }
                        if ((args as SearchPageNavArgsBase).DisplayMode == SearchPageDisplayModes.Main)
                        {
                            CurrentStatusSub = "";
                            DesktopViewModelLocator.Hamburger.ChangeBottomStackPanelMargin(index == PageIndex.PageMessanging || index == PageIndex.PageWallpapers);
                        }
                    }
                    else
                    {
                        CurrentStatusSub = "";
                        DesktopViewModelLocator.Hamburger.ChangeBottomStackPanelMargin(index == PageIndex.PageMessanging || index == PageIndex.PageWallpapers);
                    }
                    currPage = index;
                    break;
            }            

            if (index == PageIndex.PageAnimeList && _searchStateBeforeNavigatingToSearch != null)
            {
                SearchToggleStatus = (bool) _searchStateBeforeNavigatingToSearch;
                if (SearchToggleStatus)
                    ShowSearchStuff();
                else
                    HideSearchStuff();
            }

            switch (index)
            {
                case PageIndex.PageAnimeList:
                    if (ViewModelLocator.AnimeList.Initializing)
                    {
                        if (!_subscribed)
                        {
                            ViewModelLocator.AnimeList.Initialized += AnimeListOnInitialized;
                            _subscribed = true;
                        }
                        _postponedNavigationArgs = new Tuple<PageIndex, object>(originalIndex, args);
                        return;
                    }
                    _postponedNavigationArgs = null;
                    ShowSearchStuff();
                    if ((_searchStateBeforeNavigatingToSearch == null || !_searchStateBeforeNavigatingToSearch.Value) &&
                        (wasOnSearchPage || _wasOnDetailsFromSearch))
                    {
                        CurrentSearchQuery = "";
                        _wasOnDetailsFromSearch = false;
                        UnToggleSearchStuff();
                    }
                    if (CurrentMainPageKind == PageIndex.PageAnimeList)
                        ViewModelLocator.AnimeList.Init(args as AnimeListPageNavigationArgs);
                    else
                        MainNavigationRequested?.Invoke(typeof(AnimeListPage), args);
                    break;
                case PageIndex.PageAnimeDetails:
                    var detail = ViewModelLocator.AnimeDetails;
                    detail.DetailImage = null;
                    detail.LeftDetailsRow.Clear();
                    detail.RightDetailsRow.Clear();
                    OffRefreshButtonVisibility = true;
                    RefreshOffDataCommand = new RelayCommand(() => ViewModelLocator.AnimeDetails.RefreshData());
                    _wasOnDetailsFromSearch = (args as AnimeDetailsPageNavigationArgs).Source == PageIndex.PageSearch;
                    //from search , details are passed instead of being downloaded once more
                    OffContentVisibility = true;

                    if (CurrentOffPage == PageIndex.PageAnimeDetails)
                        ViewModelLocator.AnimeDetails.Init(args as AnimeDetailsPageNavigationArgs);
                    else
                        OffNavigationRequested?.Invoke(typeof(AnimeDetailsPage), args);
                    break;
                case PageIndex.PageSettings:
                    OffContentVisibility = true;
                    OffNavigationRequested?.Invoke(typeof(SettingsPage));
                    break;
                case PageIndex.PageSearch:
                case PageIndex.PageMangaSearch:
                    var arg = args as SearchPageNavigationArgs;
                    if (Settings.ForceSearchIntoOffPage || CurrentMainPage == PageIndex.PageForumIndex || CurrentMainPage == PageIndex.PageProfile)
                        arg.DisplayMode = SearchPageDisplayModes.Off;
                    if (arg.DisplayMode == SearchPageDisplayModes.Off)
                    {
                        if (CurrentMainPage == PageIndex.PageCharacterSearch)
                        {
                            ToggleSearchStuff();
                            SearchToggleLock = true;
                        }
                        if (CurrentMainPage == PageIndex.PageSearch)
                        {
                            break; // we are already on the left
                        }
                        if (string.IsNullOrWhiteSpace(arg.Query))
                            arg.Query = CurrentSearchQuery;
                        arg.DisplayMode = SearchPageDisplayModes.Off;
                        OffContentVisibility = true;
                        currOffPage = PageIndex.PageSearch;
                        currPage = null;
                        OffRefreshButtonVisibility = false;
                        ViewModelLocator.AnimeDetails.Id = -1;
                        StatusFilterVisibilityLock = false;
                        CurrentOffStatus = "Search";
                        IsCurrentStatusSelectable = false;
                        OffNavigationRequested?.Invoke(typeof(AnimeSearchPage), args);
                    }
                    else
                    {
                        if (CurrentOffPage == PageIndex.PageSearch)
                        {
                            break; // we are already on the right
                        }
                        if (CurrentMainPage.Value != PageIndex.PageSearch &&
                            CurrentMainPage.Value != PageIndex.PageMangaSearch &&
                            CurrentMainPage.Value != PageIndex.PageCharacterSearch)
                            _searchStateBeforeNavigatingToSearch = SearchToggleStatus;
                        if (arg.ByGenre || arg.ByStudio)
                        {
                            CurrentStatus = $"Anime by {(arg.ByGenre ? "Genre" : "Studio")}";
                            HideSearchStuff();
                        }
                        else
                        {
                            SearchToggleLock = true;
                            ShowSearchStuff();
                            ToggleSearchStuff();
                        }

                        StatusFilterVisibilityLock = true;
                        if (string.IsNullOrWhiteSpace(arg.Query))
                            arg.Query = CurrentSearchQuery;
                        MainNavigationRequested?.Invoke(typeof(AnimeSearchPage), args);
                        await Task.Delay(10);
                        View.SearchInputFocus(FocusState.Keyboard);
                    }
                    break;
                case PageIndex.PageLogIn:
                    OffContentVisibility = true;
                    OffNavigationRequested?.Invoke(typeof(LogInPage));
                    break;
                case PageIndex.PageProfile:
                    HideSearchStuff();
                    RefreshButtonVisibility = true;
                    if (Settings.SelectedApiType == ApiType.Mal)
                        RefreshDataCommand =
                            new RelayCommand(() => DesktopViewModelLocator.ProfilePage.LoadProfileData(null, true));
                    else
                        RefreshDataCommand = new RelayCommand(() => ViewModelLocator.HumProfilePage.Init(true));
                    if (Settings.SelectedApiType == ApiType.Mal)
                    {
                        if (CurrentMainPage == PageIndex.PageProfile)
                            DesktopViewModelLocator.ProfilePage.LoadProfileData(args as ProfilePageNavigationArgs);
                        else
                            MainNavigationRequested?.Invoke(typeof(ProfilePage), args);
                    }

                    else
                        MainNavigationRequested?.Invoke(typeof(HummingbirdProfilePage), args);
                    break;
                case PageIndex.PageRecomendations:
                    HideSearchStuff();
                    MainNavigationRequested?.Invoke(typeof(RecommendationsPage), args);
                    break;
                case PageIndex.PageCalendar:
                    HideSearchStuff();
                    RefreshButtonVisibility = true;
                    RefreshDataCommand = new RelayCommand(() => ViewModelLocator.CalendarPage.Init(true));
                    CurrentStatus = "Calendar";
                    MainNavigationRequested?.Invoke(typeof(CalendarPage), args);
                    break;
                case PageIndex.PageArticles:
                case PageIndex.PageNews:
                    HideSearchStuff();
                    RefreshButtonVisibility = true;
                    RefreshDataCommand = new RelayCommand(() => { ViewModelLocator.MalArticles.Init(null); });
                    MainNavigationRequested?.Invoke(typeof(MalArticlesPage), args);
                    break;
                case PageIndex.PageMessanging:
                    HideSearchStuff();
                    CurrentStatus = $"{Credentials.UserName} - Messages";
                    RefreshButtonVisibility = true;
                    RefreshDataCommand = new RelayCommand(() => { ViewModelLocator.MalMessaging.Init(true); });
                    MainNavigationRequested?.Invoke(typeof(MalMessagingPage), args);
                    break;
                case PageIndex.PageMessageDetails:
                    var msgModel = args as MalMessageDetailsNavArgs;
                    OffRefreshButtonVisibility = true;
                    RefreshOffDataCommand = new RelayCommand(() => ViewModelLocator.MalMessageDetails.RefreshData());
                    CurrentOffStatus = msgModel.WorkMode == MessageDetailsWorkMode.Message
                        ? (msgModel.Arg != null
                            ? $"{(msgModel.Arg as MalMessageModel)?.Sender} - {(msgModel.Arg as MalMessageModel)?.Subject}"
                            : "New Message")
                        : $"Comments {Credentials.UserName} - {(msgModel.Arg as MalComment)?.User.Name}";
                    OffContentVisibility = true;
                    OffNavigationRequested?.Invoke(typeof(MalMessageDetailsPage), args);
                    break;
                case PageIndex.PageForumIndex:
                    HideSearchStuff();
                    CurrentStatus = "Forums";
                    if (args == null || (args as ForumsNavigationArgs)?.Page == ForumsPageIndex.PageIndex)
                    {
                        RefreshButtonVisibility = true;
                        RefreshDataCommand = new RelayCommand(() => { ViewModelLocator.ForumsIndex.Init(true); });
                    }
                    else
                    {
                        var navArgs = args as ForumsNavigationArgs;
                        if (navArgs?.Page == ForumsPageIndex.PageBoard)
                        {
                            RefreshButtonVisibility = true;
                            RefreshDataCommand = new RelayCommand(() => { ViewModelLocator.ForumsBoard.Reload(); });
                        }
                    }
                    if (CurrentMainPage != null && CurrentMainPage == PageIndex.PageForumIndex)
                        ViewModelLocator.ForumsMain.Init(args as ForumsNavigationArgs);
                    else
                        MainNavigationRequested?.Invoke(typeof(ForumsMainPage), args);
                    break;
                case PageIndex.PageHistory:
                    HideSearchStuff();
                    RefreshButtonVisibility = true;
                    RefreshDataCommand = new RelayCommand(() => { ViewModelLocator.History.Init(null, true); });
                    CurrentStatus = $"History - {(args as HistoryNavigationArgs)?.Source ?? Credentials.UserName}";
                    MainNavigationRequested?.Invoke(typeof(HistoryPage), args);
                    break;
                case PageIndex.PageCharacterDetails:
                    OffRefreshButtonVisibility = true;
                    RefreshOffDataCommand = new RelayCommand(() => ViewModelLocator.CharacterDetails.RefreshData());
                    OffContentVisibility = true;

                    if (CurrentOffPage == PageIndex.PageCharacterDetails)
                        ViewModelLocator.CharacterDetails.Init(args as CharacterDetailsNavigationArgs);
                    else
                        OffNavigationRequested?.Invoke(typeof(CharacterDetailsPage), args);
                    break;
                case PageIndex.PageStaffDetails:
                    OffRefreshButtonVisibility = true;
                    RefreshOffDataCommand = new RelayCommand(() => ViewModelLocator.StaffDetails.RefreshData());
                    OffContentVisibility = true;

                    if (CurrentOffPage == PageIndex.PageStaffDetails)
                        ViewModelLocator.StaffDetails.Init(args as StaffDetailsNaviagtionArgs);
                    else
                        OffNavigationRequested?.Invoke(typeof(StaffDetailsPage), args);
                    break;
                case PageIndex.PageCharacterSearch:
                    if (CurrentMainPage.Value != PageIndex.PageSearch &&
                        CurrentMainPage.Value != PageIndex.PageMangaSearch &&
                        CurrentMainPage.Value != PageIndex.PageCharacterSearch)
                        _searchStateBeforeNavigatingToSearch = SearchToggleStatus;
                    ShowSearchStuff();
                    ToggleSearchStuff();

                    SearchToggleLock = true;
                    if (CurrentMainPage != PageIndex.PageCharacterSearch)
                        MainNavigationRequested?.Invoke(typeof(CharacterSearchPage));
                    await Task.Delay(10);
                    View.SearchInputFocus(FocusState.Keyboard);
                    break;
                case PageIndex.PageWallpapers:
                    HideSearchStuff();
                    MainNavigationRequested?.Invoke(typeof(WallpapersPage),args);
                    break;
                case PageIndex.PagePopularVideos:
                    HideSearchStuff();
                    CurrentStatus = "Popular Videos";
                    MainNavigationRequested?.Invoke(typeof(PopularVideosPage), args);
                    break;
                default:
                    throw new ArgumentOutOfRangeException(nameof(index), index, null);
            }
            if (currPage != null)
                CurrentMainPage = currPage;
            if (mainPage)
                CurrentMainPageKind = index;
            if (currOffPage != null)
                CurrentOffPage = currOffPage;
            _navigating = false;
            RaisePropertyChanged(() => SearchToggleLock);
        }