void Add(Event @event) { var tick = new FixtureTick(); tick.Event = @event; tick.OnRemove = Remove; tick.OnChangePosition = ChangePosition; tick.Initialize(); Canvas.SetBottom(tick, 0); if (tick.Event.Channel == Channel.Super) { Canvas.SetBottom(tick, Height / 2); } else { Canvas.SetBottom(tick, 0); } double offset = @event.StartTime.Subtract(Events.StartTime).TotalSeconds *WidthMultiplier; Canvas.SetLeft(tick, offset); Canvas.Children.Add(tick); eventsInRuler.Add(@event); }
void ChangePosition(FixtureTick tick) { double offset = tick.Event.StartTime.Subtract(Events.StartTime).TotalSeconds *WidthMultiplier; Canvas.SetLeft(tick, offset); }
void Remove(FixtureTick tick) { eventsInRuler.Remove(tick.Event); Canvas.Children.Remove(tick); }