void NavigatePage(string pageTitle, Page page)
        {
            if (ItemPageData.Count > 0)
            {
                PageItem data = ItemPageData.FirstOrDefault((p) => p.PageTitle.Equals(pageTitle));
                if (data != null)
                {
                    CheckedPageItem(data);
                    return;
                }
                for (int i = 0; i < ItemPageData.Count; i++)
                {
                    ItemPageData[i].CRNum     = "0,0,0,0";
                    ItemPageData[i].IsChecked = false;
                    ItemPageData[i].BackColor = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF207BBC"));
                }
            }
            PageItem item = new PageItem();

            item.CRNum     = "20,0,0,20";
            item.PageObj   = page;
            item.PageTitle = pageTitle;
            item.IsChecked = true;
            item.ItemWidth = 25 + pageTitle.Length * 16;
            item.BackColor = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF49A9FF"));
            ItemPageData.Insert(0, item);
            mainPage.Navigate(page);

            bdrMenu.Visibility = Visibility.Visible;
            bgImg.Visibility   = Visibility.Visible;
            VisualTreeHelper.GetOffset(btnExit);
            VisualTreeHelper.GetOffset(btnMinimum);
        }
        private void btnClose_Click(object sender, RoutedEventArgs e)
        {
            selectItem.IsSelected = false;
            PageItem itemInfo = ItemPageData.FirstOrDefault((p) => p.IsChecked);

            itemInfo.IsChecked = false;
            Button   btn      = sender as Button;
            PageItem pageInfo = btn.Tag as PageItem;

            if (pageInfo != null)
            {
                int index = ItemPageData.IndexOf(pageInfo);
                if (index == 0 && ItemPageData.Count > 1)
                {
                    ItemPageData[1].CRNum = "20,0,0,20";
                    if (pageInfo.IsChecked)
                    {
                        ItemPageData[1].IsChecked = true;
                        ItemPageData[1].BackColor = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF49A9FF"));
                    }
                }
                ItemPageData.Remove(pageInfo);
            }
            if (pageInfo != itemInfo)
            {
                System.Threading.ThreadPool.QueueUserWorkItem((p) => { Thread.Sleep(100);
                                                                       this.Dispatcher.Invoke(new Action(() => { itemInfo.IsChecked = true; })); });
            }
            else if (ItemPageData.Count > 0)
            {
                //ItemPageData[0].IsChecked = true;
                //ItemPageData[0].BackColor = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF49A9FF"));
                CheckedPageItem(ItemPageData[0]);
            }

            if (ItemPageData.Count == 0)
            {
                mainPage.Content   = null;
                bdrMenu.Visibility = Visibility.Hidden;
                bgImg.Visibility   = Visibility.Hidden;
            }
        }