Beispiel #1
0
        private void grid_SelectionChanged(object sender, Xceed.Wpf.DataGrid.DataGridSelectionChangedEventArgs e)
        {
            var address = grid.SelectedItem as AddressViewModel;

            if (address != null)
            {
                App.Locator.Resolve <IMessenger>().Send(new ExposePropertiesMessage(address));
            }
        }
        private void Av_Grid_Selection_Changed(object sender, DataGridSelectionChangedEventArgs e)
        {
            var dataGridControl = e.OriginalSource as Xceed.Wpf.DataGrid.DataGridControl;
            if (dataGridControl != null)
            {
                var res = (from object selectedItem in dataGridControl.SelectedItems select selectedItem as BanView).ToList();

                Model.SelectedAvailibleBans = res;
            }
        }
        private void AlignmentGrid_OnSelectionChanged(object sender, DataGridSelectionChangedEventArgs e)
        {
            if (_monitor.Busy)
                return;

            using (_monitor.Enter())
            {
                var vm = (MultipleWordAlignmentViewModel) DataContext;
                vm.SelectedWords.Clear();
                vm.SelectedWords.AddRange(AlignmentGrid.SelectedItems.Cast<MultipleWordAlignmentWordViewModel>());
            }
        }
Beispiel #4
0
        private void WordListsGrid_OnSelectionChanged(object sender, DataGridSelectionChangedEventArgs e)
        {
            if (_selectMonitor.Busy)
                return;

            using (_selectMonitor.Enter())
            {
                var vm = (WordListsViewModel) DataContext;
                if (WordListsGrid.SelectedCellRanges.Count == 1)
                {
                    SelectionCellRange cellRange = WordListsGrid.SelectedCellRanges[0];
                    int itemIndex = cellRange.ItemRange.StartIndex;
                    var variety = (WordListsVarietyViewModel) WordListsGrid.Items[itemIndex];
                    int columnIndex = cellRange.ColumnRange.StartIndex;
                    vm.SelectedVarietyMeaning = variety.Meanings[columnIndex - 1];
                }
                else
                {
                    vm.SelectedVarietyMeaning = null;
                }
            }
        }
 internal void RaiseSelectionChanged( DataGridSelectionChangedEventArgs e )
 {
   this.OnSelectionChanged( e );
 }
        /// <summary>
        /// React on selection change.
        /// </summary>
        /// <param name="sender">Ignored.</param>
        /// <param name="e">Ignored.</param>
        private void _SelectionChanged(object sender, DataGridSelectionChangedEventArgs e)
        {
            _geocodablePage.OnSelectionChanged(DataGridControl.SelectedItems);

            _SetSubPage(null);
            _ProcessLocateState();
        }
Beispiel #7
0
 void grid_SelectionChanged(object sender, Xceed.Wpf.DataGrid.DataGridSelectionChangedEventArgs e)
 {
     CoinSelectionChanged(grid);
 }
 protected virtual void OnSelectionChanged( DataGridSelectionChangedEventArgs e )
 {
   this.RaiseEvent( e );
 }
        private void Selector_OnSelectionChanged(object sender, DataGridSelectionChangedEventArgs e)
        {
            /*
             * HACK - Get Selected Job Item Updated
             * For some reason, the binding of the SelectedItem property to SelectedJob doesn't work.
             * Work around this for now by setting the property manually
             *
             * REMARKS - Using the 0th index of the collection works in this case because we have
             * set the data grid to use Single Selection Mode
             */

            if (this.viewModel.SelectedWorkItem != null)
            {
                if (e.SelectionInfos.Count > 0 && e.SelectionInfos[0].AddedItems.Count > 0)
                {
                    this.viewModel.SelectedWorkItem.SelectedJob = e.SelectionInfos[0].AddedItems[0] as JobModel;
                }
            }
        }
        private void SegmentsDataGrid_OnSelectionChanged(object sender, DataGridSelectionChangedEventArgs e)
        {
            if (_selectMonitor.Busy)
                return;

            using (_selectMonitor.Enter())
            {
                var vm = (SegmentMappingsChartViewModel) DataContext;
                if (SegmentsDataGrid.SelectedCellRanges.Count == 1)
                {
                    SelectionCellRange cellRange = SegmentsDataGrid.SelectedCellRanges[0];
                    int itemIndex = cellRange.ItemRange.StartIndex;
                    var segment = (SegmentMappingsChartSegmentViewModel) SegmentsDataGrid.Items[itemIndex];
                    int columnIndex = cellRange.ColumnRange.StartIndex;
                    SegmentMappingsChartSegmentPairViewModel segmentPair = segment.SegmentPairs[columnIndex - 1];
                    vm.SelectedSegmentPair = segmentPair.IsEnabled ? segmentPair : null;
                }
                else
                {
                    vm.SelectedSegmentPair = null;
                }
            }
        }
        private void XceedGrid_SelectionChanged(object sender, DataGridSelectionChangedEventArgs e)
        {
            _SetSelectionStatus();

            // NOTE : event raises to notify all necessary object about selection was changed. Added because XceedGrid.SelectedItems doesn't implement INotifyCollectionChanged
            if (SelectionChanged != null)
                SelectionChanged(null, EventArgs.Empty);
        }
        private void XceedGrid_SelectionChanged(object sender, DataGridSelectionChangedEventArgs e)
        {
            // NOTE : commented in xceed v 3.6  - events order changed in this version of data grid
            //if (XceedGrid.IsBeingEdited)
            //    XceedGrid.CancelEdit();
            if (e.SelectionInfos[0] != null && e.SelectionInfos[0].AddedItems.Count > 0)
                XceedGrid.BringItemIntoView(e.SelectionInfos[0].AddedItems[0]);

            if (_geocodablePage != null)
                _geocodablePage.OnSelectionChanged(XceedGrid.SelectedItems);

            // NOTE : event raises to notify all necessary object about selection was changed. Added because XceedGrid.SelectedItems doesn't implement INotifyCollectionChanged
            if (SelectionChanged != null)
                SelectionChanged(null, EventArgs.Empty);

            _SetSelectionStatus();
        }
        private void XceedGrid_SelectionChanged(object sender, DataGridSelectionChangedEventArgs e)
        {
            if (_needToUpdateStatus)
                App.Current.MainWindow.StatusBar.SetStatus(this, null);

            _needToUpdateStatus = true;
            _UpdateDeleteButtonState();
        }
        private void XceedGrid_SelectionChanged(object sender, DataGridSelectionChangedEventArgs e)
        {
            if (SelectionChanged != null)
                SelectionChanged(this, e);

            _SetSelectionStatus();
        }
 private static void DataGrid_SelectionChanged(object sender, DataGridSelectionChangedEventArgs e)
 {
     var dataGrid = (DataGridControl) sender;
     if (dataGrid != null && dataGrid.IsLoaded && dataGrid.SelectedItem != null)
     {
         dataGrid.Focus();
         dataGrid.Dispatcher.BeginInvoke(new Action(() => dataGrid.BringItemIntoView(dataGrid.SelectedItem)), DispatcherPriority.Background);
     }
 }
        /// <summary>
        /// React on selection change.
        /// </summary>
        /// <param name="sender">Ignored.</param>
        /// <param name="e">Ignored.</param>
        private void _SelectionChanged(object sender, DataGridSelectionChangedEventArgs e)
        {
            if (_inited)
            {
                if (_isSelectedByInternalGridLogic)
                {
                    DataGridControl.SelectedItems.Clear();
                    _isSelectedByInternalGridLogic = false;
                }
                else
                {
                    _geocodablePage.OnSelectionChanged(DataGridControl.SelectedItems);

                    _SetSubPage(null);
                    _ProcessLocateState();

                    if (CurrentItem != null)
                    {
                        _ProcessLocateOrder(false);
                    }
                }
            }
        }
        /// <summary>
        /// React on selection changed in grid.
        /// </summary>
        /// <param name="sender">Grid with changed selection.</param>
        /// <param name="e">Changed event args.</param>
        protected void _GridSelectionChanged(object sender, DataGridSelectionChangedEventArgs e)
        {
            Debug.Assert(sender != null);
            Debug.Assert(e != null);

            DataGridControlEx grid = (DataGridControlEx)sender;
            if (grid.SelectedItems == _suspendedCollection)
                return; // skip events from suspended collection

            var addedItems = e.SelectionInfos
                .SelectMany(info => info.AddedItems)
                .ToList();
            DataGridControlEx datagrid = (DataGridControlEx)e.Source;
            _FilterInvalidChanges(datagrid.SelectedItems, addedItems);

            var removedItems = e.SelectionInfos
                .SelectMany(info => info.RemovedItems)
                .ToList();
            var args = CommonHelpers.GetSelectionChangedArgs(addedItems, removedItems);
            if (args != null)
            {
                _CollectionChanged(grid.SelectedItems, args);
            }
        }
        /// <summary>
        /// Handler for the SelectionChanged event of Xceed DataGrid.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The event data.</param>
        private void _CustomOrderPropertiesXceedGridSelectionChanged(object sender, DataGridSelectionChangedEventArgs e)
        {
            // Bring selected item into view.
            if (e.SelectionInfos[0] != null && e.SelectionInfos[0].AddedItems.Count > 0)
                _customOrderPropertiesXceedGrid.BringItemIntoView(e.SelectionInfos[0].AddedItems[0]);

            // If selection is not empty make the Delete button available.
            _UpdateDeleteButtonAvailability();
        }
        /// <summary>
        /// React on selection changed.
        /// </summary>
        /// <param name="e">Selection changed event args.</param>
        public void OnSelectionChanged(DataGridSelectionChangedEventArgs e)
        {
            bool isToolsEnabled = false;

            // If some tool is activated - cancel edit.
            if (_IsAnyToolActivated())
                _CancelEdit();

            if (e.SelectionInfos.Count > 0)
            {
                // Check is single selection.
                if (e.SelectionInfos[0].DataGridContext.SelectedItems.Count == 1)
                {
                    _currentItem = e.SelectionInfos[0].DataGridContext.SelectedItems[0];
                    isToolsEnabled = true;

                    // Save geometry.
                    _SaveGeometry();
                }
                else if (e.SelectionInfos[0].DataGridContext.SelectedItems.Count == 0 && _dataGridControl.IsBeingEdited)
                {
                    // In case of adding new item.
                    isToolsEnabled = true;
                    _initialGeometry = null;
                }
            }

            _SetToolsEnabled(isToolsEnabled);
        }
 private void DataGridControl_SelectionChanged( object sender, DataGridSelectionChangedEventArgs e )
 {
   this.DeliverEvent( sender, e );
 }
 private void DataGridControl_SelectionChanged(object sender, DataGridSelectionChangedEventArgs e)
 {
     this.DeliverEvent(sender, e);
 }
        private void XceedGrid_SelectionChanged(object sender, DataGridSelectionChangedEventArgs e)
        {
            if (e.SelectionInfos[0] != null && e.SelectionInfos[0].AddedItems.Count > 0)
                XceedGrid.BringItemIntoView(e.SelectionInfos[0].AddedItems[0]);

            _regionsPage.OnSelectionChanged(e);

            _SetSelectionStatus();

            // NOTE : event raises to notify all necessary object about selection was changed. Added because XceedGrid.SelectedItems doesn't implement INotifyCollectionChanged
            if (SelectionChanged != null)
                SelectionChanged(null, EventArgs.Empty);
        }
        /// <summary>
        /// React on candidate selection changed.
        /// </summary>
        /// <param name="sender">Ignored.</param>
        /// <param name="e">Ignored.</param>
        private void _DataGridControlSelectionChanged(object sender, DataGridSelectionChangedEventArgs e)
        {
            _SetButtonApplyIsEnabled();

            if (CandidateChanged != null && DataGridControl.SelectedItems.Count != 0)
                CandidateChanged(this, EventArgs.Empty);
        }