//跳转到页面触发
        public override async Task OnNavigatedToAsync(object parameter, NavigationMode mode, IDictionary <string, object> suspensionState)
        {
            //对象实例化
            var result = InitAsync();
            //加载数据库数据
            var log = await LoadDbLogAsync();

            var site = await LoadDbSiteAsync();

            var selectResult = await ChartDao.SelectSitesAsync(site);

            Infos.Sites       = selectResult.Item2;
            Infos.Logs        = log;
            Infos.SelectSites = selectResult.Item1;

            //计算图表数据
            var getResult = await Task.Run(() => ChartDao.CacuChartAsync(Infos.Sites, Infos.Logs));

            Chart1Collection = getResult.Item1;
            Infos.BarChart   = getResult.Item2;
            Lengend          = await ChartDao.ChartLengendAsync(Infos.Sites);

            //默认显示全部
            Type = "All";
            //图表加载完毕后切换加载状态
            Infos.State3 = Visibility.Collapsed;
            Infos.State1 = Visibility.Visible;
        }
        /// <summary>
        /// 计算图表相关数据
        /// </summary>
        /// <param name="sites">数据库站点</param>
        /// <param name="logs">站点日志</param>
        /// <returns></returns>
        public async Task <bool> ChartAsync(List <SiteModel> sites, List <LogModel> logs)
        {
            var getResult = await Task.Run(() => ChartDao.CacuChartAsync(sites, logs));

            Chart1Collection = getResult.Item1;
            Infos.BarChart   = getResult.Item2;

            Lengend = await ChartDao.ChartLengendAsync(sites);

            return(true);
        }
        /// <summary>
        /// 确定站点并切换页面
        /// </summary>
        public async Task <bool> AcceptClickAsync()
        {
            //清空数据,重新统计
            Infos.Sites.Clear();
            Lengend.Clear();
            Chart1Collection.Clear();
            Infos.BarChart.Clear();
            foreach (var item in Infos.SelectSites.Where(i => i.IsSelected == true).Select(i => i.Site))
            {
                //获取选择的站点
                Infos.Sites.Add(item);
            }
            //选择站点数量大于上限进行提示
            if (Infos.Sites.Count > MAX_NUMBER_OF_SITE)
            {
                var msgDialog = new Windows.UI.Popups.MessageDialog("站点最多选择五个!!")
                {
                    Title = "错误提示"
                };
                await msgDialog.ShowAsync();

                return(false);
            }
            else
            {
                Infos.State1 = Visibility.Visible;
                Infos.State2 = Visibility.Collapsed;

                //重新统计数据
                var getResult = await Task.Run(() => ChartDao.CacuChartAsync(Infos.Sites, Infos.Logs));

                Chart1Collection = getResult.Item1;
                Infos.BarChart   = getResult.Item2;
                Lengend          = await ChartDao.ChartLengendAsync(Infos.Sites);

                //统计完成后触发此方法,计算前台需要显示的数据
                TypeChanged(Type);
                return(true);
            }
        }