Пример #1
0
        private void TabStrip_DragItemsStarting(object sender, DragItemsStartingEventArgs e)
        {
            var data = e.Data;

            TabData tab_data = this.TabStrip.SelectedItem as TabData;

            if (tab_data == null)
            {
                return;
            }

            data.SetText(tab_data.UniqueID);

            data.RequestedOperation = DataPackageOperation.Move;

            FrameData framedata = Navigator.ShellData.FindFrameData(tab_data);

            if (framedata.Index == 0)
            {
                Navigator.ShellData.Frames[0].AllowDrop = false;
                Navigator.ShellData.Frames[1].AllowDrop = true;
            }
            else // 1
            {
                Navigator.ShellData.Frames[0].AllowDrop = true;
                Navigator.ShellData.Frames[1].AllowDrop = false;
            }

            Navigator.ShellData.SplitScreen = true;
        }
Пример #2
0
    private void CollectedItemsListView_DragItemsStarting(object sender, DragItemsStartingEventArgs e)
    {
        var item = string.Join(",", e.Items.Cast <Information>().Select(i => i.Id));

        e.Data.SetText(item);
        e.Data.RequestedOperation = DataPackageOperation.Move;
    }
Пример #3
0
        private void ListView_DragItemsStarting(object sender, DragItemsStartingEventArgs e)
        {
            e.Data.Properties.Add(DragItemKey, e.Items.FirstOrDefault());
            e.Data.Properties.Add(SourceItemsKey, Element.ItemsSource);

            e.Data.RequestedOperation = DataPackageOperation.Move;
        }
        private void ListView_DragItemsStarting(object sender, DragItemsStartingEventArgs e)
        {
            var items = e.Items.Cast <CustomItem>().Select(i => i.OriginalStorageItem);

            e.Data.SetStorageItems(items);
            e.Data.RequestedOperation = DataPackageOperation.Copy;
        }
Пример #5
0
        }//mag glass button

        private void DragStart(object sender, DragItemsStartingEventArgs e)
        {
            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.Move;
            Sources.Background        = SB;
            foreach (ListView thisList in setterLists)
            {
                thisList.AllowDrop  = false;
                thisList.Background = new SolidColorBrush(Windows.UI.Colors.LightGray);
            }

            //mainSource = true;
        }//drag from source
Пример #6
0
        private void SongVersionTabs_DragItemsStarting(object sender, DragItemsStartingEventArgs e)
        {
            var   c     = (Frame)e.Items[0];
            Album album = new Album();

            if (c.Tag is long playlistid)
            {
                album = SongListStorage.PlaylistDict[playlistid];
            }
            else if (c.Tag is string albumid)
            {
                album = SongListStorage.AlbumDict[albumid];
            }
            var songids = album.Songids;

            var items = new StringBuilder();

            foreach (String songid in songids)
            {
                if (items.Length > 0)
                {
                    items.AppendLine();
                }
                items.Append(songid);
            }
            var t = items.ToString();

            e.Data.SetText(items.ToString());

            e.Data.RequestedOperation = DataPackageOperation.Copy;
        }
Пример #7
0
        private void GridView_DragItemsStarting(object sender, DragItemsStartingEventArgs e)
        {
            //e.Data.RequestedOperation = Windows.ApplicationModel.DataTransfer.DataPackageOperation.Copy;
            var t = (IGalleryItem)e.Items[0];

            e.Data.SetText(t.Id);
        }
Пример #8
0
 private void grdSourceImages_DragItemsStarting(object sender, DragItemsStartingEventArgs e)
 {
     //Retrieve a reference of the image being dragged
     DraggedItems = e.Items;
     isDragging   = true;
     appbarGameCommands.IsOpen = false;
 }
Пример #9
0
        private void ImageListView_DragItemsStarting(object sender, DragItemsStartingEventArgs e)
        {
            var items = string.Join(",", e.Items.Cast <ImageItem>().Select(i => i.Id));

            e.Data.SetText(items);
            e.Data.RequestedOperation = Windows.ApplicationModel.DataTransfer.DataPackageOperation.Move;
        }
Пример #10
0
 private void ListViewDragItemsStarting(object sender, DragItemsStartingEventArgs e)
 {
     if (this.DragItemsStarting != null)
     {
         this.DragItemsStarting.Invoke(this, e);
     }
 }
Пример #11
0
 private void LocationsPanel_DragItemsStarting(object sender, DragItemsStartingEventArgs e)
 {
     if (!EditMode)
     {
         ToggleEditMode();
     }
 }
        /// <summary>
        /// Обрабатывает начало перемещения элемента (drag'n'drop) из списка.
        /// </summary>
        /// <param name="sender">Объект-отправитель.</param>
        /// <param name="e">Передаваемые данные.</param>
        public void OnDragItemsStarting(object sender, DragItemsStartingEventArgs e)
        {
            e.Data.RequestedOperation = DataPackageOperation.Copy;
            ushort id = ((ListWordViewModel)(e.Items[0])).ID;

            e.Data.SetText(id.ToString());
        }
Пример #13
0
        private void OnDragItemsStarting(object sender, DragItemsStartingEventArgs e)
        {
            //Debug.WriteLine("OnDragItemsStarting");
            isReordering = false;

#if WINDOWS_UWP
            e.Data.RequestedOperation = Windows.ApplicationModel.DataTransfer.DataPackageOperation.Move;
#endif

            draggingItemIndex_original = -1;
            draggingItemIndex_elements = -1;
            if (e.Items.Count < 1)
            {
                return;
            }

            var itemContainer = (sender as ListViewBase).ContainerFromItem(e.Items[0]) as UIElement;
            if (itemContainer == null)
            {
                return;
            }

            draggingItemIndex_original = (sender as ListViewBase).IndexFromContainer(itemContainer);
            draggingItemIndex_elements = draggingItemIndex_original;

            isReordering = true;
        }
Пример #14
0
        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;
        }
Пример #15
0
        private void View_DragItemsStarting(object sender, DragItemsStartingEventArgs e)
        {
            DragItems = e.Items;
            bool a = (sender as GridView).Items.Contains(AddIcon);

            IsAddNewItem = true;
        }
Пример #16
0
        private async void MasterViewList_OnDragItemsStarting(object sender, DragItemsStartingEventArgs e)
        {
            try
            {
                foreach (var item in e.Items)
                {
                    var document = (DrxDocumentViewModel)item;
                    if (document.Encrypted)
                    {
                        // TODO: don't handle encrypted documents yet
                        e.Cancel = true;
                        return;
                    }

                    // Ensure the body's loaded before we do this
                    await document.Model.LoadBodyAsync();

                    e.Data.SetExportedDrx(document.Model, document.Store.Model);
                    e.Data.RequestedOperation = DataPackageOperation.Copy;
                }
            }
            catch (Exception)
            {
                e.Cancel = true;
            }
        }
Пример #17
0
        private void CardContentListView_DragItemsStarting(object sender, DragItemsStartingEventArgs e)
        {
            CardContent        dragCardContent     = e.Items[0] as CardContent;
            CardTitleViewModel originalCardTitleVM = this.cardTitleVM;

            ListViewChangeItemEvent(originalCardTitleVM, dragCardContent);
        }
Пример #18
0
        public void ListView_DragItemsStarting(object sender, DragItemsStartingEventArgs e)
        {
            var  item = e.Items[0];
            Note it   = item as Note;

            movedObject    = it;
            objectWasMoved = false;

            var destinationListView = sender as ListView;
            var listViewItemsSource = destinationListView?.ItemsSource as ObservableCollection <Note>;

            source = listViewItemsSource;

            //Debug.WriteLine(it.header);
            e.Data.RequestedOperation = DataPackageOperation.Move;

            //CHECK IF IT'S LAST NOTE
            //SO YOU CAN DISPLAY X FOR REMOVING
            if (listViewItemsSource.Last() == movedObject)
            {
                isRemoveVisible = Visibility.Visible;
            }

            //CREATE EMPTY LISTVIEW IF SOURCE.COUNT > 1
            if (listViewItemsSource.Count > 1)
            {
                if (listViewItemsSource[0] != movedObject)
                {
                    var empty = new CollectionRepresentation {
                        NoteCollection = new ObservableCollection <Note>()
                    };
                    NotesCollection.Add(empty);
                }
            }
        }
Пример #19
0
        private void gridView_DragItemsStarting(object sender, DragItemsStartingEventArgs e)
        {
            e.Data.RequestedOperation = DataPackageOperation.Move;
            var item = e.Items[0] as Repo;

            e.Data.SetText(item.id.ToString());
        }
        private async void TabsListView_DragItemsStarting(object sender, DragItemsStartingEventArgs e)
        {
            if (TabsListView.Items.Count == 1 && !CoreApplication.GetCurrentView().IsMain)
            {
                await ApplicationViewSwitcher.SwitchAsync(((App)Application.Current).Views[0].ViewId, this.ViewId, ApplicationViewSwitchingOptions.ConsolidateViews);
            }
            DataModel model;

            foreach (var item in e.Items)
            {
                if (!"Default Tab".Equals(item))
                {
                    currentItem = TabsListView.Items.Single((i) =>
                    {
                        var t = i as ListViewItem;
                        return(t.Content == item);
                    }) as ListViewItem;

                    model = currentItem.DataContext as DataModel;

                    e.Data.SetData("Name", currentItem.Content.ToString());
                    e.Data.SetData("GUID", model.Id.ToString());
                    ((App)Application.Current).CurrentViewID = this.ViewId;
                }
                else
                {
                    e.Cancel = true;
                    return;
                }
            }
            ;
            e.Data.RequestedOperation = DataPackageOperation.Move;
        }
Пример #21
0
        private void lvProps_DragItemsStarting(object sender, DragItemsStartingEventArgs e)
        {
            var id = e.Items.Cast <Prop>().First().id.ToString(); //e.Items.Cast<Prop>().Select(i => i.id).ToString();

            e.Data.SetText(id);
            e.Data.RequestedOperation = DataPackageOperation.Move;
        }
Пример #22
0
        private void SetsView_DragItemsStarting(object sender, DragItemsStartingEventArgs e)
        {
            // Keep track of drag so we don't modify content until done.
            _isDragging = true;

            _setsItemsScrollViewerLeftSideShadow.Visibility  = Visibility.Collapsed;
            _setsItemsScrollViewerRightSideShadow.Visibility = Visibility.Collapsed;
        }
 private void listView_DragItemsStarting(object sender, DragItemsStartingEventArgs e)
 {
     draggedItems.Clear();
     foreach (string item in e.Items)
     {
         draggedItems.Add(item);
     }
 }
Пример #24
0
        private void listViewItems_DragItemsStarting(object sender, DragItemsStartingEventArgs e)
        {
            ColorCollectionItem ci = (ColorCollectionItem)e.Items.FirstOrDefault();

            e.Data.SetText(ci.GetDefaultExport());
            e.Data.Properties.Add("item", ci);
            e.Data.RequestedOperation = DataPackageOperation.Copy | DataPackageOperation.Move;
        }
        }             // End CommunicationBar_Drop

        //  ====================  DRAG AND DROP FROM COMMUNICATION BAR TO DISPLAY  ====================

        private void CommunicationBar_DragItemsStarting(object sender, DragItemsStartingEventArgs e)
        {
            // Get ID of card and set as a string
            var card = string.Concat(e.Items.Cast <Picture>().Select(i => i.pictureId));

            e.Data.SetText(card);
            e.Data.RequestedOperation = DataPackageOperation.Move;
        }
Пример #26
0
 private void CategoryArchives_DragItemsStarting(object sender, DragItemsStartingEventArgs e)
 {
     e.Data.RequestedOperation = DataPackageOperation.Move;
     if (e.Items.Any())
     {
         e.Data.Properties.Add("archivesRemove", JsonConvert.SerializeObject(e.Items.ToList()));
     }
 }
Пример #27
0
 private void ListView_DragItemsStarting(object sender, DragItemsStartingEventArgs e)
 {
     if (e.Items.Count == 1)
     {
         e.Data.SetText(Newtonsoft.Json.JsonConvert.SerializeObject(e.Items[0]));
         e.Data.RequestedOperation = DataPackageOperation.Move;
     }
 }
Пример #28
0
 private void ArchivesGrid_DragItemsStarting(object sender, DragItemsStartingEventArgs e)
 {
     e.Data.RequestedOperation = DataPackageOperation.Link;
     if (e.Items.Any())
     {
         e.Data.Properties.Add("archivesAdd", JsonConvert.SerializeObject(e.Items.ToList()));
     }
 }
Пример #29
0
        /// <summary>Handles the DragItemsStarting event of the GameProfileChallenges control.</summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="DragItemsStartingEventArgs" /> instance containing the event data.</param>
        private void GameProfileChallenges_DragItemsStarting(object sender, DragItemsStartingEventArgs e)
        {
            var challengeType = (((sender as ListView).Parent as Grid).Parent as Expander).Header + ";";
            var challengeIDs  = string.Join(",", e.Items.Cast <ChallengeBase>().Select(i => i.ChallengeID));

            e.Data.SetText(challengeType + challengeIDs);
            e.Data.RequestedOperation = DataPackageOperation.Move;
        }
Пример #30
0
 private void AssociatedObject_DragItemsStarting(object sender, DragItemsStartingEventArgs e)
 {
     e.Data.RequestedOperation = Windows.ApplicationModel.DataTransfer.DataPackageOperation.Copy;
     if (e.Items != null && e.Items.Any())
     {
         e.Data.Properties.Add("item", e.Items.FirstOrDefault());
     }
 }