private void GridViewDragItemsStarting(object sender, DragItemsStartingEventArgs e) { var item = e.Items.FirstOrDefault(); if (item == null) return; e.Data.Properties.Add("item", item); e.Data.Properties.Add("gridSource", sender); }
private void SourceListView_DragItemsStarting(object sender, DragItemsStartingEventArgs e) { ListView source = sender as ListView; if (source.Equals(ActionSequence)) { DDH = new DragDropHelper<CortanaCommand>(ActionSequence, ActionPicker); } else { DDH = new DragDropHelper<CortanaCommand>(ActionPicker, ActionSequence); } DDH.SourceListView_DragItemsStarting(sender, e); }
private void ListView_DragItemsStarting(object sender, DragItemsStartingEventArgs e) { //foreach (var item in e.Items) //{ // // If you want to drop only a subset of the dragged items, // // then make each key unique. // e.Data.Properties.Add("MyApp.MyCity", item); //} //DragDropEffects }
private void gview_DragItemsStarting(object sender, DragItemsStartingEventArgs e) { var item = e.Items.FirstOrDefault() as Book; if (item == null) { e.Cancel = true; return; } e.Data.Properties.Add("item", item); e.Data.Properties.Add("gridSource", sender); }
private void GridView_DragItemsStarting(object sender, DragItemsStartingEventArgs e) { var items = new StringBuilder(); Monster m = e.Items[0] as Monster; items.Append(m.ID.ToString() + "\n"); e.Data.SetText(items.ToString()); e.Data.RequestedOperation = DataPackageOperation.Copy; }
/// <summary> /// DragItemsStarting is called when the Drag and Drop operation starts /// We take advantage of it to set the content of the DataPackage /// as well as indicate which operations are supported /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SourceListView_DragItemsStarting(object sender, DragItemsStartingEventArgs e) { // Prepare a string with one dragged item per line var items = new StringBuilder(); foreach (var item in e.Items) { if (items.Length > 0) items.AppendLine(); items.Append(item as string); } // Set the content of the DataPackage e.Data.SetText(items.ToString()); // As we want our Reference list to say intact, we only allow Copy e.Data.RequestedOperation = DataPackageOperation.Copy; }
//DragAndDrop trought two ListViews private void ListPerson_DragItemsStarting(object sender, Windows.UI.Xaml.Controls.DragItemsStartingEventArgs e) { var items = new StringBuilder(); foreach (Worker item in e.Items) { if (items.Length > 0) { items.AppendLine(); } //Get Name as ID to identify Person //items.Append(item.Name); } e.Data.SetText(items.ToString()); //Icon When Drag e.Data.RequestedOperation = DataPackageOperation.Move; //Save Source of the dragAndDrop Action e.Data.Properties.Add("SourceList", sender as ListView); }
private void OnDragItemsStarting(object sender, DragItemsStartingEventArgs e) { _draggedFrom = sender as GridView; _draggedPiece = e.Items.OfType<PieceElement>().First(); }
/// <summary> /// DragtemsStarting is called for D&D and reorder as the framework does not /// know wherer the user will drop the items. Reorder means that the target /// and the source ListView are the same. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void TargetListView_DragItemsStarting(object sender, DragItemsStartingEventArgs e) { // The ListView is declared with selection mode set to Single. // But we want the code to be robust if (e.Items.Count == 1) { e.Data.SetText(e.Items[0] as string); // Reorder or move to trash are always a move e.Data.RequestedOperation = DataPackageOperation.Move; _deletedItem = null; } }
void ListViewBase_OnDragItemsStarting(object sender, DragItemsStartingEventArgs e) { var disk = e.Items.First() as Disk; e.Data.Properties.Add(Constants.SOURCE_DISK, disk); e.Data.Properties.Add(Constants.SOURCE_POLE, sender as ListView); }
/// <summary> /// DragtemsStarting is called for D&D and reorder as the framework does not /// know wherer the user will drop the items. Reorder means that the target /// and the source ListView are the same. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void TargetListView_DragItemsStarting(object sender, DragItemsStartingEventArgs e) { // The ListView is declared with selection mode set to Single. // But we want the code to be robust if (e.Items.Count == 1) { var items = string.Join(",", e.Items.Cast<Palestrante>().Select(i => i.nome)); e.Data.SetText(items); e.Data.RequestedOperation = DataPackageOperation.Move; _deletedItem = null; } }
private void lvAssignedComponent_DragItemsStarting(object sender, DragItemsStartingEventArgs e) { lvAssignedComponent.SelectedItem = e.Items; }
private void ItemListView_DragItemsStarting(object sender, DragItemsStartingEventArgs e) { e.Data.SetData("itemIndex", storeData.Collection.IndexOf(e.Items[0] as Item).ToString()); }
private void TagView_DragItemsStarting(object sender, DragItemsStartingEventArgs e) { DraggedTag = e.Items[0].ToString(); MainPage.DraggedItem = e.Items[0].ToString(); //this.TitleTextBox.Text = "dragging"; }
private void DragStart(object sender, DragItemsStartingEventArgs e) { factory.DragPic = (Image)e.Items.ElementAt(0); factory.IsDragingPic = true; }
private void ListView_DragStarting(object sender, DragItemsStartingEventArgs e) { int itemCount = e.Items.Count; e.Data.SetText(itemCount.ToString()); List<StorageFile> fileList = new List<StorageFile>(); foreach (FileItem fileItem in e.Items) { fileList.Add((StorageFile)fileItem); } e.Data.SetStorageItems(fileList); e.Data.RequestedOperation = DataPackageOperation.Copy; DragPanelStatus(true); }
private void lvCrew_DragItemsStarting(object sender, DragItemsStartingEventArgs e) { var items = e.Items.ToObservableCollection(); e.Data.RequestedOperation = DataPackageOperation.Move; e.Data.SetDataProvider("Crew", request => request.SetData(items)); }
private void ItemGridView2_DragItemsStarting(object sender, DragItemsStartingEventArgs e) { e.Data.SetData("data", (e.Items[0] as Item).Title); }
private void UnorganizedListView_OnDragItemsStarting(object sender, DragItemsStartingEventArgs e) { var items = string.Join(",", e.Items.Cast<MyItem>().Select(i => i.Id)); e.Data.SetText(items); e.Data.RequestedOperation = DataPackageOperation.Move; }
private void DragItemsStarting(object sender, DragItemsStartingEventArgs e) { Win8Client.SideBySideStrategyView.PrepareDragAndDrop(e); foreach (var item in e.Items) { if (!this.AllCardsListView.SelectedItems.Contains(item)) { this.AllCardsListView.SelectedItems.Add(item); } } }
private void WeightList_DragItemsStarting(object sender, DragItemsStartingEventArgs e) { Debug.WriteLine("aaa"); }
private void lvSpec_DragItemsStarting(object sender, DragItemsStartingEventArgs e) { }
private void CurrentCardsListView_DragItemsStarting(object sender, DragItemsStartingEventArgs e) { Win8Client.SideBySideStrategyView.PrepareDragAndDrop(e); this.CurrentCardsListView.SelectedItems.Clear(); }
//오른쪽 -> 왼쪽 private void lvFiwpITRForms_DragItemsStarting(object sender, DragItemsStartingEventArgs e) { lvFiwpITRForms.SelectedItem = e.Items; }
private void View_DragItemsStarting(object sender, DragItemsStartingEventArgs e) { DragItems = e.Items; bool a = (sender as GridView).Items.Contains(AddIcon); IsAddNewItem = true; }
/// <summary> /// DragItemsStarting is called when the Drag and Drop operation starts /// We take advantage of it to set the content of the DataPackage /// as well as indicate which operations are supported /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SourceListView_DragItemsStarting(object sender, DragItemsStartingEventArgs e) { var items = string.Join(",", e.Items.Cast<Palestrante>().Select(i => i.nome)); e.Data.SetText(items); e.Data.RequestedOperation = DataPackageOperation.Copy; }
private async void DragMenuGridView2_DragItemsStarting(object sender, DragItemsStartingEventArgs e) { e.Data.SetData("ItemNumber2", siList2.IndexOf(e.Items[0] as StaffItem).ToString()); // await new MessageDialog(siList2.IndexOf(e.Items[0] as StaffItem).ToString()).ShowAsync(); }
void itemView_DragItemsStarting(object sender, DragItemsStartingEventArgs e) { // TODO 读取正在拖动的数据对象 }
private async void DragMenuGridView_DragItemsStarting(object sender, DragItemsStartingEventArgs e) { // e.Data.SetData("itemIndex", storeData.Collection.IndexOf(e.Items[0] as Item).ToString()); e.Data.SetData("ItemNumber", siList.IndexOf(e.Items[0] as StaffItem).ToString()); //await new MessageDialog(siList.IndexOf(e.Items[0] as StaffItem).ToString()).ShowAsync(); }
private void TargetListView_DragItemsStarting(object sender, DragItemsStartingEventArgs e) { DDH.TargetListView_DragItemsStarting(sender, e); }
private void GridViewEx_DragItemsStarting(object sender, DragItemsStartingEventArgs e) { // highlight dragging item ChangeItemHighlightingStatus(e.Items[0]); }