/// <summary> /// Move selected items to front (beginning of the list) /// </summary> /// <returns> /// true if at least one object is moved /// </returns> public bool MoveSelectionToFront() { int n = _graphicsList.Count; var tempList = new ArrayList(); for (int i = n - 1; i >= 0; i--) { if (((DrawObject)_graphicsList[i]).Selected) { tempList.Add(_graphicsList[i]); } } var cmd = new BringToFrontCommand(_graphicsList, tempList); cmd.Execute(); _undoRedo.AddCommand(cmd); return(true); }
private void SelectedItemsOnCollectionChanged(object sender, NotifyCollectionChangedEventArgs notifyCollectionChangedEventArgs) { BringToFrontCommand.RaiseCanExecuteChanged(); SendToBackCommand.RaiseCanExecuteChanged(); }