Пример #1
0
        //查询提交
        private void AutoSuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
        {
            if (args.ChosenSuggestion != null)
            {
                PhotoFile pf = args.ChosenSuggestion as PhotoFile;

                if (pf.isAdd == Visibility.Visible)
                {
                    AddContentDialog.ShowAsync();//Add:添加
                }
                else
                {
                    string path = pf.Path;
                    var    xdoc = XDocument.Load(path);

                    MainBottom(xdoc);
                    App.Model.StartVisibility = Visibility.Collapsed;
                }
            }
            else
            {
                // Do a fuzzy search on the query text
                //模糊搜索查询文本吗
                //    var matchingContacts = GetMatchingContacts(args.QueryText);

                // Choose the first match, or clear the selection if there are no matches.
                //选择第一个匹配,或明确的选择如果没有匹配。
                //SelectContact(matchingContacts.FirstOrDefault());
            }
        }
Пример #2
0
        //点击进入
        private void AdaptiveGridViewControl_ItemClick(object sender, ItemClickEventArgs e)
        {
            PhotoFile pf = e.ClickedItem as PhotoFile;

            if (pf.isAdd == Visibility.Visible)
            {
                AddContentDialog.ShowAsync();//Add:添加
            }
            else
            {
                try
                {
                    var xdoc = XDocument.Load(pf.Path);

                    App.Model.Name = pf.Name;//重命名

                    //宽高
                    App.Model.Width  = (int)xdoc.Descendants("Width").Single();
                    App.Model.Height = (int)xdoc.Descendants("Height").Single();

                    MainBottom(xdoc);

                    App.Model.StartVisibility = Visibility.Collapsed;
                }
                catch (Exception)
                {
                }
            }
        }
Пример #3
0
        public void BrowseForLayer(EventHandler <BrowseForLayerCompletedEventArgs> onComplete, object userState = null)
        {
            AddContentDialog browseDialog = new AddContentDialog()
            {
                MaxHeight = Application.Current.RootVisual.RenderSize.Height - 200,
                Height    = 600,
                Width     = 500,
            };

            browseDialog.ConnectionsProvider = View.Instance.ConnectionsProvider;
            browseDialog.LayerAdded         += new EventHandler <LayerAddedEventArgs>(browseDialog_LayerAdded);
            browseDialog.Tag = new object[] { onComplete, userState };
            MapApplication.Current.ShowWindow(ESRI.ArcGIS.Mapping.Builder.Resources.Strings.BrowseForResource, browseDialog, true);
        }
Пример #4
0
 private void AddAppBarButton_Click(object sender, RoutedEventArgs e)
 {
     AddContentDialog.ShowAsync();//Add:添加
 }