Ejemplo n.º 1
0
 public static IScriptCommand EndLiteDrag(string dragSourceVariable  = "{ISupportDrag}",
                                          IScriptCommand nextCommand = null, IScriptCommand failCommand = null)
 {
     return
         (HubScriptCommands.AssignDragMethod(QueryDrag.DragMethodKey,
                                             new DragDropLiteCommand()
     {
         State = DragDropLiteState.EndLite,
         DragSourceKey = dragSourceVariable,
         NextCommand = (ScriptCommandBase)nextCommand,
         FailCommand = (ScriptCommandBase)failCommand
     }));
 }
        public static IScriptCommand StartShellDrag(string iShellDragVariable = "{DragDrop.SupportDrag}", IScriptCommand nextCommand = null)
        {
            return
                //If CanDrag (ItemUnderMouse is selected), Check and set IsDraggingProperty to true.
                (ScriptCommands.SetPropertyValue(iShellDragVariable, (ISupportDrag d) => d.IsDraggingFrom, true,
                                                 HubScriptCommands.AssignDragMethod(QueryDrag.DragMethodKey,

                                                                                    //Initialize shell based drag drop
                                                                                    HubScriptCommands.QueryDrag(iShellDragVariable, "{DragResult}",
                                                                                    //Reset IsDragging property.
                                                                                                                ScriptCommands.SetPropertyValue(iShellDragVariable, (ISupportDrag d) => d.IsDraggingFrom, false,
                                                                                    //Reset IShellDrag variable.
                                                                                                                                                ScriptCommands.Assign(iShellDragVariable, null, false,
                                                                                                                                                                      nextCommand))))));
        }