Esempio n. 1
0
        /// <summary>
        /// 创建 dataPage页面,首先要传入  装载页面的容器 PageView,这个方法有缓存
        /// </summary>
        /// <param name="pLayer"></param>
        /// <returns></returns>
        public static PagerPage CreateMapDataPage(ILayer pLayer)
        {
            PagerPage page;

            if (userControlReids.TryGetValue(pLayer, out page))
            {
                for (int a = 0; a < pageView.Items.Count; a++)
                {
                    if ((pageView.Items[a] as PageViewItem).Header.Equals(pLayer.Name))
                    {
                        //pageView.SelectedIndex = a;
                        if (a != pageView.Items.Count - 1)
                        {
                            var temp = pageView.Items[a];
                            pageView.Items.RemoveAt(a);
                            pageView.Items.Add(temp);
                            pageView.SelectedIndex = pageView.Items.Count - 1;
                            //pageView.Items.Insert(0,temp);
                            // pageView.SelectedIndex = 0;
                        }
                        break;
                    }
                }
                return(page);
            }
            IList <IFeature> features = ArcGisUtils.GetFeatures(pLayer);

            page = CreateMapDataPage(pLayer, features);
            userControlReids.Add(pLayer, page);
            return(page);
        }