예제 #1
0
        private static void OnFileSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            DrawingControl control = (DrawingControl)d;

            control._FileSource = e.NewValue?.ToString();

            control.OnFileSourceChanged(control._FileSource);
        }
예제 #2
0
        private static void OnItemsSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            DrawingControl control = (DrawingControl)d;

            if (e.NewValue is IEnumerable <IRoute> enumerable)
            {
                control._items.Clear();
                control._items.AddRange(enumerable.OfType <IRoute>());
            }
            else
            {
                control._items.Clear();
            }

            control.OnItemsSourceChanged(e.NewValue as IEnumerable <IRoute>);
        }