Beispiel #1
0
        private void FeatureLayer_MouseLeftButtonUp(object sender, GraphicMouseButtonEventArgs e)
        {
            var fl = (sender) as FeatureLayer;

            e.Graphic.Select();
            MyDataGrid.ScrollIntoView(e.Graphic, null);
        }
 private void FeatureLayer_MouseLeftButtonDown(object sender, GraphicMouseButtonEventArgs args)
 {
     args.Graphic.Selected = !args.Graphic.Selected;
     if (args.Graphic.Selected)
     {
         MyDataGrid.ScrollIntoView(args.Graphic, null);
     }
 }
 public void FindNextWordCommandExecute()
 {
     currentIndex++;
     currentIndex  %= ResultList.Count;
     SelectedResult = ResultList.ElementAt(currentIndex);
     MyDataGrid.UpdateLayout();
     MyDataGrid.ScrollIntoView(MyDataGrid.SelectedItem);
 }
 public void FindPreviousWordCommandExecute()
 {
     currentIndex--;
     if (currentIndex < 0)
     {
         currentIndex = ResultList.Count - 1;
     }
     SelectedResult = ResultList.ElementAt(currentIndex);
     MyDataGrid.UpdateLayout();
     MyDataGrid.ScrollIntoView(MyDataGrid.SelectedItem);
 }
Beispiel #5
0
        private void FeatureLayer_MouseLeftButtonUp(object sender, GraphicMouseButtonEventArgs e)
        {
            if (_lastGraphic != null)
            {
                _lastGraphic.UnSelect();
            }

            e.Graphic.Select();
            if (e.Graphic.Selected)
            {
                MyDataGrid.ScrollIntoView(e.Graphic, null);
            }

            _lastGraphic = e.Graphic;
        }
 private void FeatureLayer_MouseLeftButtonDown(object sender, GraphicMouseButtonEventArgs e)
 {
     if (e.Graphic != null && !e.Graphic.Selected && (sender as FeatureLayer).IsUpdateAllowed(e.Graphic))
     {
         Editor editor = LayoutRoot.Resources["MyEditor"] as Editor;
         if ((sender as FeatureLayer).IsUpdateAllowed(e.Graphic))
         {
             if (editor.EditVertices.CanExecute(null))
             {
                 editor.EditVertices.Execute(null);
             }
         }
         else
         if (editor.CancelActive.CanExecute(null))
         {
             editor.CancelActive.Execute(null);
         }
     }
     (sender as FeatureLayer).ClearSelection();
     e.Graphic.Select();
     MyDataGrid.ScrollIntoView(e.Graphic, null);
 }
Beispiel #7
0
        private void MyDataGrid_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
            if (MyDataGrid.Items.Count == 0)
            {
                return;
            }

            int firstLine;

            if (MyDataGrid.SelectedIndex <= 10)
            {
                firstLine = 0;
            }
            else if (MyDataGrid.Items.Count - MyDataGrid.SelectedIndex > 30)
            {
                firstLine = MyDataGrid.SelectedIndex - 10;
            }
            else
            {
                firstLine = MyDataGrid.SelectedIndex;
            }

            MyDataGrid.ScrollIntoView(MyDataGrid.Items[firstLine]);
        }
Beispiel #8
0
 private void ScrollToSelection()
 {
     MyDataGrid.Items.MoveCurrentTo(MyDataGrid.SelectedItem);
     MyDataGrid.ScrollIntoView(MyDataGrid.SelectedItem);
 }