Пример #1
0
        void Add(Event @event)
        {
            var tick = new SelectionTick();

            tick.Event            = @event;
            tick.OnRemove         = Remove;
            tick.OnChangePosition = ChangePosition;
            tick.Initialize();

            const int widthOfTick = 6;

            Canvas.SetBottom(tick, 0);
            double offset = (@event.StartTime.Subtract(Events.StartTime).TotalSeconds *WidthMultiplier) - widthOfTick / 2;

            Canvas.SetLeft(tick, offset);
            Canvas.Children.Add(tick);

            eventsInRuler.Add(@event);
        }
Пример #2
0
        void ChangePosition(SelectionTick tick)
        {
            double offset = tick.Event.StartTime.Subtract(Events.StartTime).TotalSeconds *WidthMultiplier;

            Canvas.SetLeft(tick, offset);
        }
Пример #3
0
 void Remove(SelectionTick tick)
 {
     eventsInRuler.Remove(tick.Event);
     Canvas.Children.Remove(tick);
 }