public IControl CreateResizeControl(CanvasItem itemToResize, IUserInputReceiver parent, IEdgeSnappingEngine snappingEngine) { return new ControlAdapter(new ResizeControl { CanvasItem = itemToResize, FrameOfReference = parent, SnappingEngine = snappingEngine }); }
public UIResizeOperationHandleConnector(ICanvasItem canvasItem, IUserInputReceiver parent, IEdgeSnappingEngine snappingEngine) { CanvasItem = canvasItem; Parent = parent; SnappingEngine = snappingEngine; Handles = new Dictionary <IUserInputReceiver, IPoint>(); }
public Point GetMousePositionRelativeTo(IUserInputReceiver inputReceiver) { var mousePositionRelativeTo = Mouse.GetPosition((IInputElement)inputReceiver); var pclPoint = Mapper.Map <Point>(mousePositionRelativeTo); return(pclPoint); }
public UIResizeOperationHandleConnector(ICanvasItem canvasItem, IUserInputReceiver parent, IEdgeSnappingEngine snappingEngine) { CanvasItem = canvasItem; Parent = parent; SnappingEngine = snappingEngine; Handles = new Dictionary<IUserInputReceiver, IPoint>(); }
public IControl CreateResizeControl(CanvasItem itemToResize, IUserInputReceiver parent, IEdgeSnappingEngine snappingEngine) { return(new ControlAdapter(new ResizeControl { CanvasItem = itemToResize, FrameOfReference = parent, SnappingEngine = snappingEngine })); }
public void SetDragTarget(IUserInputReceiver hitTestReceiver, ICanvasItem itemToDrag) { if (this.dragRecordingScope != null) { throw new InvalidOperationException("There is already an active drag operation."); } this.ItemToDrag = itemToDrag; hitTestReceiver.FingerDown += TargetOnPreviewMouseLeftButtonDown; }
private void SetupDragOperationHost(IUserInputReceiver movingControl) { DragOperationHost.SetDragTarget(movingControl, WrappedSelectedItems); var items = DesignSurface.Children; var allExceptTarget = items.Except(WrappedSelectedItems.Children); DragOperationHost.SnappingEngine.Magnets = allExceptTarget.ToList(); }
public void SetDragTarget(IUserInputReceiver hitTestReceiver, ICanvasItem itemToDrag) { if ( this.dragRecordingScope != null ) { throw new InvalidOperationException("There is already an active drag operation."); } this.ItemToDrag = itemToDrag; hitTestReceiver.FingerDown += TargetOnPreviewMouseLeftButtonDown; }
protected void OnFrameOfReferenceChanged(IUserInputReceiver oldFrameOfReference, IUserInputReceiver newFrameOfReference) { if (IsLoaded) { RegisterHandles(); } else { Loaded += OnLoaded; } }
public Point GetMousePositionRelativeTo(IUserInputReceiver inputReceiver) { var receiver = (UIElement)inputReceiver; var position = receiver .TransformToVisual(Window.Current.Content) .TransformPoint(new FoundationPoint()); var finalPosition = new FoundationPoint( position.X + Window.Current.CoreWindow.PointerPosition.X, position.Y + Window.Current.CoreWindow.PointerPosition.Y ); return(Mapper.Map <Point>(finalPosition)); }
public Point GetMousePositionRelativeTo(IUserInputReceiver inputReceiver) { var receiver = (UIElement) inputReceiver; var position = receiver .TransformToVisual(Window.Current.Content) .TransformPoint(new FoundationPoint()); var finalPosition = new FoundationPoint( position.X + Window.Current.CoreWindow.PointerPosition.X, position.Y + Window.Current.CoreWindow.PointerPosition.Y ); return Mapper.Map<Point>(finalPosition); }
public UserKeyboardController(IUserInputReceiver receiver) { lastPressedKeys = new List <Keys>(); centralReceiver = receiver; controllerKeyMapping = new Dictionary <Keys, Action> { { Keys.Down, centralReceiver.MoveDown }, { Keys.Left, centralReceiver.MoveLeft }, { Keys.Right, centralReceiver.MoveRight }, { Keys.None, centralReceiver.MoveHorizontalIdle }, { Keys.Up, centralReceiver.MoveUp }, { Keys.X, centralReceiver.PerformAction }, { Keys.R, centralReceiver.Reset }, { Keys.A, centralReceiver.CharacterSwap }, }; }
public GamePadController(IUserInputReceiver receiver) { centralReceiver = receiver; LeftStickMappings = new Dictionary <GamePadStickDirection, Action> { { GamePadStickDirection.Left, receiver.MoveLeft }, { GamePadStickDirection.Right, receiver.MoveRight }, { GamePadStickDirection.Up, receiver.MoveUp }, { GamePadStickDirection.Down, receiver.MoveDown }, { GamePadStickDirection.Center, receiver.MoveHorizontalIdle }, }; ButtonMappings = new Dictionary <GamePadButtons, Action> { { GamePadButtons.A, receiver.MoveUp }, { GamePadButtons.B, receiver.PerformAction } }; }
protected void OnFrameOfReferenceChanged(IUserInputReceiver oldFrameOfReference, IUserInputReceiver newFrameOfReference) { }
public IControl CreateResizeControl(CanvasItem itemToResize, IUserInputReceiver parent, IEdgeSnappingEngine snappingEngine) { return(new ControlAdapter(new ResizeControl(itemToResize, parent, snappingEngine))); }
public DragOperationHost(IUserInputReceiver frameOfReference) { FrameOfReference = frameOfReference; SnappingEngine = new NoEffectsCanvasItemSnappingEngine(); IsDragging = false; }
public IControl CreateResizeControl(CanvasItem itemToResize, IUserInputReceiver parent, IEdgeSnappingEngine snappingEngine) { return new ControlAdapter(new ResizeControl(itemToResize, parent, snappingEngine)); }
public void RegisterHandle(IUserInputReceiver handle, IPoint point) { Handles.Add(handle, point); handle.FingerDown += HandleOnMouseLeftButtonDown; }
public Point GetPosition(IUserInputReceiver relativeTo) { return(ServiceLocator.InputProvider.GetMousePositionRelativeTo(relativeTo)); }
public ResizeControl(ICanvasItem itemToResize, IUserInputReceiver parent, IEdgeSnappingEngine snappingEngine) { SnappingEngine = snappingEngine; FrameOfReference = parent; CanvasItem = itemToResize; }
public Point GetMousePositionRelativeTo(IUserInputReceiver inputReceiver) { var mousePositionRelativeTo = Mouse.GetPosition((IInputElement)inputReceiver); var pclPoint = Mapper.Map<Point>(mousePositionRelativeTo); return pclPoint; }
public Point GetPosition(IUserInputReceiver relativeTo) { return ServiceLocator.InputProvider.GetMousePositionRelativeTo(relativeTo); }