private void DragCompleted() { // Hack, one of these ends up null and I'm not sure why try { if (_adorner == null || _adorner.Parent == null) { return; } Canvas.SetLeft(this, _adorner.LeftOffset); Canvas.SetTop(this, _adorner.TopOffset); ((AdornerLayer)_adorner.Parent).Remove(_adorner); _adorner = null; //var marker = (Marker)DataContext; //ushort count = _takeAll ? marker.Count : (ushort)1; //var e = new MarkerEventArgs(this, marker, count); //Mouse.DirectlyOver.RaiseEvent(e); //if (Keyboard.IsKeyUp(Key.LeftAlt) && !e.Handled) // marker.Count -= count; } catch (Exception ex) { Log.Warn("DragCompleted", ex); } }
private void DragCompleted() { // Hack, one of these ends up null and I'm not sure why try { if (_adorner == null || _adorner.Parent == null) { return; } ((AdornerLayer)_adorner.Parent).Remove(_adorner); _adorner = null; var marker = (Marker)DataContext; ushort count = _takeAll ? marker.Count : (ushort)1; var e = new MarkerEventArgs(this, marker, count); Mouse.DirectlyOver.RaiseEvent(e); if (Keyboard.IsKeyUp(Key.LeftAlt) && !e.Handled) { Program.Client.Rpc.RemoveMarkerReq(marker.Card, marker.Model.Id, marker.Model.Name, count, marker.Count, false); marker.Card.RemoveMarker(marker, count); } } catch (Exception ex) { Log.Warn("DragCompleted", ex); } }
private void DragStarted() { // Hides the card view //RaiseEvent(new CardEventArgs(CardControl.CardHoveredEvent, this)); UIElement adorned = this;//_takeAll ? this : (UIElement)img1; _mouseOffset = TranslatePoint(_mousePt, adorned); _mouseOffset.X -= adorned.DesiredSize.Width / 2; _mouseOffset.Y -= adorned.DesiredSize.Height / 2; _adorner = new Adorners.DragAdorner(adorned); AdornerLayer.GetAdornerLayer(_adorner.AdornedElement).Add(_adorner); }
private void DragCompleted() { ((AdornerLayer)_adorner.Parent).Remove(_adorner); _adorner = null; var marker = (Marker)DataContext; ushort count = _takeAll ? marker.Count : (ushort)1; var e = new MarkerEventArgs(this, marker, count); Mouse.DirectlyOver.RaiseEvent(e); if (Keyboard.IsKeyUp(Key.LeftAlt) && !e.Handled) { marker.Count -= count; } }
private void DragCompleted() { // Hack, one of these ends up null and I'm not sure why if (_adorner == null || _adorner.Parent == null) { return; } ((AdornerLayer)_adorner.Parent).Remove(_adorner); _adorner = null; var marker = (Marker)DataContext; ushort count = _takeAll ? marker.Count : (ushort)1; var e = new MarkerEventArgs(this, marker, count); Mouse.DirectlyOver.RaiseEvent(e); if (Keyboard.IsKeyUp(Key.LeftAlt) && !e.Handled) { marker.Count -= count; } }
private void DragCompleted() { // Hack, one of these ends up null and I'm not sure why try { if (_adorner == null || _adorner.Parent == null) return; ((AdornerLayer)_adorner.Parent).Remove(_adorner); _adorner = null; var marker = (Marker)DataContext; ushort count = _takeAll ? marker.Count : (ushort)1; var e = new MarkerEventArgs(this, marker, count); Mouse.DirectlyOver.RaiseEvent(e); if (Keyboard.IsKeyUp(Key.LeftAlt) && !e.Handled) { Program.Client.Rpc.RemoveMarkerReq(marker.Card, marker.Model.Id, marker.Model.Name, count, marker.Count, false); marker.Card.RemoveMarker(marker, count); } } catch (Exception ex) { Log.Warn("DragCompleted",ex); } }
private void DragStarted() { // Hides the card view RaiseEvent(new CardEventArgs(CardControl.CardHoveredEvent, this)); _takeAll = Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift); UIElement adorned = _takeAll ? this : (UIElement) img1; _mouseOffset = TranslatePoint(_mousePt, adorned); _mouseOffset.X -= adorned.DesiredSize.Width/2; _mouseOffset.Y -= adorned.DesiredSize.Height/2; _adorner = new Adorners.DragAdorner(adorned); AdornerLayer.GetAdornerLayer(_adorner.AdornedElement).Add(_adorner); }
private void DragCompleted() { // Hack, one of these ends up null and I'm not sure why try { if (_adorner == null || _adorner.Parent == null) return; Canvas.SetLeft(this, _adorner.LeftOffset); Canvas.SetTop(this, _adorner.TopOffset); ((AdornerLayer)_adorner.Parent).Remove(_adorner); _adorner = null; //var marker = (Marker)DataContext; //ushort count = _takeAll ? marker.Count : (ushort)1; //var e = new MarkerEventArgs(this, marker, count); //Mouse.DirectlyOver.RaiseEvent(e); //if (Keyboard.IsKeyUp(Key.LeftAlt) && !e.Handled) // marker.Count -= count; } catch (Exception ex) { Log.Warn("DragCompleted", ex); } }
private void DragCompleted() { // Hack, one of these ends up null and I'm not sure why if (_adorner == null || _adorner.Parent == null) return; ((AdornerLayer) _adorner.Parent).Remove(_adorner); _adorner = null; var marker = (Marker) DataContext; ushort count = _takeAll ? marker.Count : (ushort) 1; var e = new MarkerEventArgs(this, marker, count); Mouse.DirectlyOver.RaiseEvent(e); if (Keyboard.IsKeyUp(Key.LeftAlt) && !e.Handled) marker.Count -= count; }
private void DragCompleted() { ((AdornerLayer) _adorner.Parent).Remove(_adorner); _adorner = null; var marker = (Marker) DataContext; ushort count = _takeAll ? marker.Count : (ushort) 1; var e = new MarkerEventArgs(this, marker, count); Mouse.DirectlyOver.RaiseEvent(e); if (Keyboard.IsKeyUp(Key.LeftAlt) && !e.Handled) marker.Count -= count; }