public static void PropertiesEdgeWindow(Edge edge)
        {
            EdgeProperty propertyWindow = new EdgeProperty();

            propertyWindow.weightEdge.Text = edge.Weight.ToString();

            propertyWindow.weightEdge.Tag = edge;

            propertyWindow.weightEdge.TextChanged += weightEdge_TextChanged;

            foreach (var color in Globals.Colors)
            {
                Button newButton = new Button
                {
                    Height     = 18,
                    Width      = 18,
                    Background = color,
                    Tag        = edge,
                    Margin     = new Thickness(2.5)
                };

                newButton.Click += changeColorEdge;

                propertyWindow.colorBar.Items.Add(newButton);
            }

            propertyWindow.ShowDialog();
        }
Пример #2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.myWindow = ((Graph_Editor.PropertiesWindow.EdgeProperty)(target));
                return;

            case 2:
                this.fullWindow = ((System.Windows.Controls.Grid)(target));
                return;

            case 3:
                this.weightEdge = ((System.Windows.Controls.TextBox)(target));

            #line 10 "..\..\..\PropertiesWindow\EdgeProperty.xaml"
                this.weightEdge.KeyDown += new System.Windows.Input.KeyEventHandler(this.weightEdge_KeyDown);

            #line default
            #line hidden
                return;

            case 4:
                this.labeWeight = ((System.Windows.Controls.Label)(target));
                return;

            case 5:
                this.colorBar = ((System.Windows.Controls.ToolBar)(target));
                return;

            case 6:
                this.labelColor = ((System.Windows.Controls.Label)(target));
                return;

            case 7:
                this.buttonClose = ((System.Windows.Controls.Button)(target));

            #line 14 "..\..\..\PropertiesWindow\EdgeProperty.xaml"
                this.buttonClose.Click += new System.Windows.RoutedEventHandler(this.buttonClose_Click);

            #line default
            #line hidden
                return;

            case 8:
                this.logo = ((System.Windows.Controls.Image)(target));
                return;
            }
            this._contentLoaded = true;
        }