private static void ToolBarDragDropCompleted(object sender, DragDropCompletedEventArgs e) { RadToolBar toolBar = e.Source as RadToolBar; DragDropInfo info = GetDragDropInfo(e.Data); if (toolBar == null || info == null) { return; } DragDropManager.RemoveDragDropCompletedHandler(info.ToolBar, ToolBarDragDropCompleted); DragDropManager.RemoveGiveFeedbackHandler(info.ToolBar, ToolBarGiveFeedback); ClearActiveToolBarStyle(info.ToolBar); ClearHitTesting(info.Tray.Items); CloseHost(info); if (info.DragVisual.Child != null) { info.DragVisual.Child = null; Window dragVisualWindow = Window.GetWindow(info.DragVisual); InitializeHost(info.ToolBar, dragVisualWindow.Left, dragVisualWindow.Top); } HideNewBandIndicator(info.Tray); e.Handled = true; }
private void OnElementDragDropCompleted(object sender, DragDropCompletedEventArgs e) { if (this.DraggingCandidate != null && this.MaximizedItem != null) { this.FinishDrag(); e.Handled = true; } }
private void OnDragDropCompleted(object sender, DragDropCompletedEventArgs e) { var draggedItem = DragDropPayloadManager.GetDataFromObject(e.Data, "DraggedData"); if (e.Effects != DragDropEffects.None) { var collection = (sender as RadGridView).ItemsSource as IList; collection.Remove(draggedItem); } }
/// <summary> /// Raises the DragCompleted event. /// </summary> /// <param name="args">Information about the event.</param> private static void OnDragCompleted(DragDropCompletedEventArgs args) { _dragOperationInProgress = null; EventHandler <DragDropCompletedEventArgs> handler = DragDropCompleted; if (handler != null) { handler(null, args); } }
private void OnDragDropCompleted(object sender, DragDropCompletedEventArgs e) { var isDropSuccessful = DragDropPayloadManager.GetDataFromObject(e.Data, "IsDropSuccessful"); if (isDropSuccessful != null && (bool)isDropSuccessful) { var data = DragDropPayloadManager.GetDataFromObject(e.Data, "DragData"); ((IList)(sender as RadListBox).ItemsSource).Remove(data); } e.Handled = true; }
private void OnDragDropCompleted(object sender, DragDropCompletedEventArgs args) { var data = DragDropPayloadManager.GetDataFromObject(args.Data, "DragData"); var param = new DragDropParameter { DraggedItem = data, ItemsSource = this.AssociatedObject.ItemsSource }; if (this.DragCommand != null && this.DragCommand.CanExecute(param)) { this.DragCommand.Execute(param); } }
private static void ToolBarDragDropCompleted(object sender, DragDropCompletedEventArgs e) { RadToolBar toolBar = e.Source as RadToolBar; DragDropInfo info = GetDragDropInfo(e.Data); if (toolBar == null || info == null) { return; } DragDropManager.RemoveDragDropCompletedHandler(info.ToolBar, ToolBarDragDropCompleted); ClearActiveToolBarStyle(info.ToolBar); ClearHitTesting(info.Tray.Items); HideNewBandIndicator(info.Tray); e.Handled = true; }
private void OnDragDropCompleted(object sender, DragDropCompletedEventArgs e) { Debug.WriteLine("GridViewDragDropBehavior.OnDragDropCompleted: {0}", e.Effects); var data = DragDropPayloadManager.GetDataFromObject(e.Data, "DraggedData") as IList; var details = DragDropPayloadManager.GetDataFromObject(e.Data, "DropDetails"); Debug.WriteLine(e.Effects); // Remove Element from source list if drag drop effect is move /*if (e.Effects == DragDropEffects.Move) * { * var collection = (details as DropIndicationDetails).DragSource as IList; * foreach(var element in data) * { * collection.Remove(element); * } * }*/ }
private void ListDropComplete(object sender, DragDropCompletedEventArgs e) { if (e.Effects != DragDropEffects.None) { var formats = DragDropPayloadManager.GetFormats(e.Data) as string[]; if (formats.Length > 0) { var options = DragDropPayloadManager.GetDataFromObject(e.Data, formats[0]) as IList; if (options.Count > 0) { ApplicationModule optianModule = options[0] as ApplicationModule; if (sender == listBox1) { ViewModel.AppUnRelationModule(optianModule.ModuleID); } else if (sender == listBox2) { ViewModel.AppRelationModule(optianModule.ModuleID); } } } } }
private void OnDragDropCompleted(object sender, DragDropCompletedEventArgs e) { this.HideDropPositionFeedbackPresenter(); }
private void OnDragDropCompleted(object sender, DragDropCompletedEventArgs e) { (sender as TextBox).Text = ""; }
private void OnDragDropCompleted(object sender, DragDropCompletedEventArgs e) { }
private void OnDragDropCompleted(object sender, DragDropCompletedEventArgs e) { //todo //var options = // DragDropPayloadManager.GetDataFromObject(e.Data, TreeViewDragDropOptions.Key) as TreeViewDragDropOptions; //if (options != null) //{ // options.DropAction = DropAction.None; // if (options.DropTargetItem != null) // { // var dropPosition = options.DropPosition; // ExportGroupVm newParentGroupVm = null; // var newParentInvestigation = false; // var targetDropItem = options.DropTargetItem; // switch (dropPosition) // { // case DropPosition.After: // case DropPosition.Before: // if (targetDropItem.DataContext.GetType() == typeof(InvestigationVm)) // newParentInvestigation = true; // else // newParentGroupVm = targetDropItem.ParentItem.DataContext as ExportGroupVm; // break; // case DropPosition.Inside: // if (targetDropItem.DataContext.GetType() == typeof(InvestigationVm)) // newParentInvestigation = true; // else // newParentGroupVm = targetDropItem.DataContext as ExportGroupVm; // break; // } // foreach (var draggedItem in options.DraggedItems) // { // if (draggedItem.GetType() == typeof(ExportGroupVm)) // { // var draggedGroup = draggedItem as ExportGroupVm; // if (draggedGroup != null) // { // if (newParentInvestigation) // draggedGroup.MoveGroupToParentId(_context.Investigation.Id); // else // draggedGroup.MoveGroup(newParentGroupVm); // } // } // else if (draggedItem.GetType() == typeof(ExportVm)) // { // if (!newParentInvestigation) // { // var draggedResult = draggedItem as ExportVm; // if (draggedResult != null) // { // draggedResult.MoveResult(newParentGroupVm); // } // } // } // } // } //} //e.Handled = true; }
private static void OnElementDragDropCompleted(object sender, DragDropCompletedEventArgs e) { arrowContainer.IsOpen = false; rootVisual.AllowDrop = allowDropCache; }