public void Show(Position pos) { if (!Application.Current.Dispatcher.CheckAccess()) { var action = new Action<Position>(Show); Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, action); return; } lock (this) { AllowsTransparency = true; PopupAnimation = PopupAnimation.Slide; HorizontalOffset = pos.OffsetX; VerticalOffset = pos.OffsetY; IsOpen = true; StaysOpen = true; } RaiseIsActivatedEvent(); }
private Position ObtainAndAppendPosition() { var position = new Position(); if (IsEmptyPositionQueue()) { position = ObtainFirstNewPosition(); Positions.Add(position); } else if (AllPositionsAreOccupied()) { position = ObtainLastNewPosition(); Positions.Add(position); } else if (ExistFreePosition()) position = ObtainFirstFreePosition(); return position; }
private void ReleasePosition(Position position) { position.IsOccupied = false; position.Id = String.Empty; }
private void OccupyPosition(Position position, string id) { position.Id = id; position.IsOccupied = true; }