예제 #1
0
        private static void MarkerItemSourceChangeCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            TimedStateMarkerDisplay instance = d as TimedStateMarkerDisplay;
            var oldValues = e.OldValue as IEnumerable <AnimatedKeyframeViewModel>;

            if (oldValues != null)
            {
                foreach (var item in oldValues)
                {
                    item.PropertyChanged -= instance.HandleItemPropertyChanged;
                }
            }

            var newValues = e.NewValue as IEnumerable <AnimatedKeyframeViewModel>;

            if (newValues != null)
            {
                foreach (var item in newValues)
                {
                    item.PropertyChanged += instance.HandleItemPropertyChanged;
                }
            }
            instance.RefreshRectangles();
        }
예제 #2
0
        private static void RangePropertyChangeCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            TimedStateMarkerDisplay display = d as TimedStateMarkerDisplay;

            display.RefreshRectangles();
        }