Esempio n. 1
0
        public EdgeControl(VertexControl source, VertexControl target, object edge, bool showArrows = true)
        {
            DataContext = edge;
            Source      = source; Target = target;
            Edge        = edge; DataContext = edge;
            this.SetCurrentValue(ShowArrowsProperty, showArrows);
            IsHiddenEdgesUpdated = true;

#if METRO
            DefaultStyleKey = typeof(EdgeControl);
#elif WPF
#endif

            if (!this.IsInDesignMode())
            {
                EventOptions = new EdgeEventOptions(this);
                foreach (var item in Enum.GetValues(typeof(EventType)).Cast <EventType>())
                {
                    UpdateEventhandling(item);
                }

                // Trigger initial state
                SourceChanged();
                TargetChanged();
            }

            IsSelfLooped = IsSelfLoopedInternal;
        }
Esempio n. 2
0
        public EdgeControl(VertexControl source, VertexControl target, object edge, bool showLabels = false, bool showArrows = true)
        {
            DataContext = edge;
            Source      = source; Target = target;
            Edge        = edge; DataContext = edge;
            this.SetCurrentValue(ShowArrowsProperty, showArrows);
            this.SetCurrentValue(ShowLabelProperty, showLabels);
            IsHiddenEdgesUpdated = true;

#if METRO
            DefaultStyleKey = typeof(EdgeControl);
#elif WPF
#endif

            if (!this.IsInDesignMode())
            {
                EventOptions = new EdgeEventOptions(this);
                foreach (var item in Enum.GetValues(typeof(EventType)).Cast <EventType>())
                {
                    UpdateEventhandling(item);
                }

#if WPF
                ActivateSourceListener();
                ActivateTargetListener();
#elif METRO
                SourceChanged(null, null);
                _sourceWatcher = this.WatchProperty("Source", SourceChanged);
                _targetWatcher = this.WatchProperty("Target", TargetChanged);
#endif
            }

            IsSelfLooped = IsSelfLoopedInternal;
        }
Esempio n. 3
0
        public EdgeControl(VertexControl source, VertexControl target, object edge, bool showLabels = false, bool showArrows = true)
        {
            DataContext = edge;
            Source      = source; Target = target;
            Edge        = edge; DataContext = edge;
            SetCurrentValue(ShowArrowsProperty, showArrows);
            ShowLabel            = showLabels;
            IsHiddenEdgesUpdated = true;

            if (!DesignerProperties.GetIsInDesignMode(this))
            {
                EventOptions = new EdgeEventOptions(this);
                foreach (var item in Enum.GetValues(typeof(EventType)).Cast <EventType>())
                {
                    UpdateEventhandling(item);
                }

                ActivateSourceListener();
                ActivateTargetListener();
            }

            /*var dpd = DependencyPropertyDescriptor.FromProperty(SourceProperty, typeof(EdgeControl));
             * if (dpd != null) dpd.AddValueChanged(this, SourceChanged);
             * dpd = DependencyPropertyDescriptor.FromProperty(TargetProperty, typeof(EdgeControl));
             * if (dpd != null) dpd.AddValueChanged(this, TargetChanged);*/

            IsSelfLooped = _isSelfLooped;
        }
Esempio n. 4
0
        public EdgeControl(VertexControl source, VertexControl target, object edge, bool showLabels = false, bool showArrows = true)
        {
            DefaultStyleKey      = typeof(EdgeControl);
            DataContext          = edge;
            Source               = source; Target = target;
            Edge                 = edge; DataContext = edge;
            ShowArrows           = showArrows;
            ShowLabel            = showLabels;
            IsHiddenEdgesUpdated = true;

            EventOptions = new EdgeEventOptions(this);
            foreach (var item in Enum.GetValues(typeof(EventType)).Cast <EventType>())
            {
                UpdateEventhandling(item);
            }

            TargetChanged(null, null);
            SourceChanged(null, null);
            _sourceWatcher = this.WatchProperty("Source", SourceChanged);
            _targetWatcher = this.WatchProperty("Target", TargetChanged);
        }