示例#1
0
        public async void Drag(object sender, PointerPressedEventArgs e)
        {
            if (!selected)
            {
                Select(e);
            }

            DataObject dragData = new DataObject();

            dragData.Set("chain", Track.Get(_chain)?.Window?.Selection.Selection);

            DragDropEffects result = await DragDrop.DoDragDrop(dragData, DragDropEffects.Move);

            if (result == DragDropEffects.None)
            {
                if (selected)
                {
                    Select(e);
                }

                if (e.MouseButton == MouseButton.Left)
                {
                    ChainExpanded?.Invoke(_chain.ParentIndex.Value);
                }

                if (e.MouseButton == MouseButton.Right)
                {
                    ChainContextMenu.Open(Draggable);
                }
            }
        }
示例#2
0
        public void DragFailed(PointerPressedEventArgs e)
        {
            PointerUpdateKind MouseButton = e.GetCurrentPoint(this).Properties.PointerUpdateKind;

            if (MouseButton == PointerUpdateKind.LeftButtonPressed)
            {
                ChainExpanded?.Invoke(_chain.ParentIndex.Value);
            }

            if (MouseButton == PointerUpdateKind.RightButtonPressed)
            {
                MuteItem.Header = ((Chain)Track.Get(_chain)?.Window?.Selection.Selection.First()).Enabled? "Mute" : "Unmute";
                ((ApolloContextMenu)this.Resources["ChainContextMenu"]).Open(Draggable);
            }
        }
示例#3
0
        public async void Drag(object sender, PointerPressedEventArgs e)
        {
            PointerUpdateKind MouseButton = e.GetCurrentPoint(this).Properties.PointerUpdateKind;

            if (!selected)
            {
                Select(e);
            }

            DataObject dragData = new DataObject();

            dragData.Set("chain", Track.Get(_chain)?.Window?.Selection.Selection);

            App.Dragging = true;
            DragDropEffects result = await DragDrop.DoDragDrop(e, dragData, DragDropEffects.Move);

            App.Dragging = false;

            if (result == DragDropEffects.None)
            {
                if (selected)
                {
                    Select(e);
                }

                if (MouseButton == PointerUpdateKind.LeftButtonPressed)
                {
                    ChainExpanded?.Invoke(_chain.ParentIndex.Value);
                }

                if (MouseButton == PointerUpdateKind.RightButtonPressed)
                {
                    MuteItem.Header = ((Chain)Track.Get(_chain)?.Window?.Selection.Selection.First()).Enabled? "Mute" : "Unmute";
                    ((ApolloContextMenu)this.Resources["ChainContextMenu"]).Open(Draggable);
                }
            }
        }