当前位置: 首页>>代码示例>>C#>>正文


C# TextBox.SetBinding方法代码示例

本文整理汇总了C#中TextBox.SetBinding方法的典型用法代码示例。如果您正苦于以下问题:C# TextBox.SetBinding方法的具体用法?C# TextBox.SetBinding怎么用?C# TextBox.SetBinding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TextBox的用法示例。


在下文中一共展示了TextBox.SetBinding方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DataGridLengthEditorGrid

        public DataGridLengthEditorGrid()
        {
            this.ColumnDefinitions.Add(new ColumnDefinition());
            ColumnDefinition columnDefinition = new ColumnDefinition();
            columnDefinition.Width = GridLength.Auto;
            this.ColumnDefinitions.Add(columnDefinition);

            _textBox = new TextBox();
            Binding binding = new Binding("Text");
            binding.Mode = BindingMode.TwoWay;
            _textBox.SetBinding(TextBox.TextProperty, binding);
            _textBox.KeyDown += new KeyEventHandler(TextBox_KeyDown);
            _textBox.DataContext = this;
            this.Children.Add(_textBox);

            _comboBox = new ComboBox();
            _comboBox.SetValue(Grid.ColumnProperty, 1);
            // Unfortunately, there's no built in way to tell the ComboBox to be as wide as the widest item
            _comboBox.MinWidth = 95; 
            _comboBox.SelectionChanged += new SelectionChangedEventHandler(ComboBox_SelectionChanged);
            DataGridLengthUnitType[] items = 
            {
                DataGridLengthUnitType.Auto,
                DataGridLengthUnitType.Pixel,
                DataGridLengthUnitType.SizeToCells,
                DataGridLengthUnitType.SizeToHeader
            };
            _comboBox.ItemsSource = items;
            this.Children.Add(_comboBox);
        }
开发者ID:kvervo,项目名称:HorizontalLoopingSelector,代码行数:30,代码来源:DataGridLengthEditorGrid.cs

示例2: Initialize

        public void Initialize()
        {
            this._dataField = new DataField();
            this._dataField2 = new DataField();

            this._textBox = new TextBox();
            this._textBox.SetBinding(TextBox.TextProperty, new Binding("StringProperty") { Mode = BindingMode.TwoWay });

            this._dataField.Content = this._textBox;

            TextBox textBox2 = new TextBox();
            textBox2.SetBinding(TextBox.TextProperty, new Binding("IntProperty") { Mode = BindingMode.TwoWay });

            this._dataField2.Content = textBox2;
        }
开发者ID:shijiaxing,项目名称:SilverlightToolkit,代码行数:15,代码来源:DataFieldTests.cs

示例3: SetupCustomUIElements

            public override void SetupCustomUIElements(Controls.dynNodeView NodeUI)
            {
                //add a text box to the input grid of the control
                tb = new TextBox();
                tb.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
                tb.VerticalAlignment = System.Windows.VerticalAlignment.Center;
                NodeUI.inputGrid.Children.Add(tb);
                System.Windows.Controls.Grid.SetColumn(tb, 0);
                System.Windows.Controls.Grid.SetRow(tb, 0);

                //turn off the border
                SolidColorBrush backgroundBrush = new SolidColorBrush(System.Windows.Media.Color.FromArgb(0, 0, 0, 0));
                tb.Background = backgroundBrush;
                tb.BorderThickness = new Thickness(0);

                tb.DataContext = this;
                var bindingSymbol = new System.Windows.Data.Binding("Symbol")
                {
                    Mode = BindingMode.TwoWay
                };
                tb.SetBinding(TextBox.TextProperty, bindingSymbol);

                tb.TextChanged += new TextChangedEventHandler(tb_TextChanged);
            }
开发者ID:romeo08437,项目名称:Dynamo,代码行数:24,代码来源:dynFunction.cs

示例4: Get_TabControl_Items

 private static System.Collections.ObjectModel.ObservableCollection<object> Get_TabControl_Items()
 {
     System.Collections.ObjectModel.ObservableCollection<object> items = new System.Collections.ObjectModel.ObservableCollection<object>();
     // e_3 element
     TabItem e_3 = new TabItem();
     e_3.Name = "e_3";
     e_3.HorizontalContentAlignment = HorizontalAlignment.Stretch;
     e_3.Header = "Controls";
     // e_4 element
     Grid e_4 = new Grid();
     e_3.Content = e_4;
     e_4.Name = "e_4";
     RowDefinition row_e_4_0 = new RowDefinition();
     row_e_4_0.Height = new GridLength(1F, GridUnitType.Auto);
     e_4.RowDefinitions.Add(row_e_4_0);
     RowDefinition row_e_4_1 = new RowDefinition();
     row_e_4_1.Height = new GridLength(1F, GridUnitType.Auto);
     e_4.RowDefinitions.Add(row_e_4_1);
     RowDefinition row_e_4_2 = new RowDefinition();
     row_e_4_2.Height = new GridLength(1F, GridUnitType.Auto);
     e_4.RowDefinitions.Add(row_e_4_2);
     RowDefinition row_e_4_3 = new RowDefinition();
     row_e_4_3.Height = new GridLength(1F, GridUnitType.Auto);
     e_4.RowDefinitions.Add(row_e_4_3);
     RowDefinition row_e_4_4 = new RowDefinition();
     row_e_4_4.Height = new GridLength(1F, GridUnitType.Auto);
     e_4.RowDefinitions.Add(row_e_4_4);
     RowDefinition row_e_4_5 = new RowDefinition();
     row_e_4_5.Height = new GridLength(1F, GridUnitType.Auto);
     e_4.RowDefinitions.Add(row_e_4_5);
     RowDefinition row_e_4_6 = new RowDefinition();
     row_e_4_6.Height = new GridLength(1F, GridUnitType.Auto);
     e_4.RowDefinitions.Add(row_e_4_6);
     RowDefinition row_e_4_7 = new RowDefinition();
     row_e_4_7.Height = new GridLength(1F, GridUnitType.Auto);
     e_4.RowDefinitions.Add(row_e_4_7);
     RowDefinition row_e_4_8 = new RowDefinition();
     row_e_4_8.Height = new GridLength(1F, GridUnitType.Auto);
     e_4.RowDefinitions.Add(row_e_4_8);
     RowDefinition row_e_4_9 = new RowDefinition();
     row_e_4_9.Height = new GridLength(1F, GridUnitType.Auto);
     e_4.RowDefinitions.Add(row_e_4_9);
     ColumnDefinition col_e_4_0 = new ColumnDefinition();
     col_e_4_0.Width = new GridLength(1F, GridUnitType.Auto);
     e_4.ColumnDefinitions.Add(col_e_4_0);
     ColumnDefinition col_e_4_1 = new ColumnDefinition();
     e_4.ColumnDefinitions.Add(col_e_4_1);
     // e_5 element
     TextBlock e_5 = new TextBlock();
     e_4.Children.Add(e_5);
     e_5.Name = "e_5";
     e_5.VerticalAlignment = VerticalAlignment.Center;
     e_5.Text = "Button";
     // button1 element
     Button button1 = new Button();
     e_4.Children.Add(button1);
     button1.Name = "button1";
     button1.Height = 30F;
     button1.Width = 200F;
     button1.Margin = new Thickness(5F, 5F, 5F, 5F);
     button1.HorizontalAlignment = HorizontalAlignment.Left;
     button1.TabIndex = 1;
     button1.Content = "Button 1";
     button1.CommandParameter = "Click Button 1";
     Grid.SetColumn(button1, 1);
     Grid.SetRow(button1, 0);
     Binding binding_button1_Command = new Binding("ButtonCommand");
     button1.SetBinding(Button.CommandProperty, binding_button1_Command);
     // button2 element
     Button button2 = new Button();
     e_4.Children.Add(button2);
     button2.Name = "button2";
     button2.Height = 30F;
     button2.Width = 200F;
     button2.Margin = new Thickness(5F, 5F, 5F, 5F);
     button2.HorizontalAlignment = HorizontalAlignment.Left;
     button2.TabIndex = 2;
     button2.Content = "Button 2";
     button2.CommandParameter = "Click Button 2";
     Grid.SetColumn(button2, 1);
     Grid.SetRow(button2, 1);
     Binding binding_button2_IsEnabled = new Binding("ButtonEnabled");
     button2.SetBinding(Button.IsEnabledProperty, binding_button2_IsEnabled);
     Binding binding_button2_Command = new Binding("ButtonCommand");
     button2.SetBinding(Button.CommandProperty, binding_button2_Command);
     // buttonResult element
     TextBlock buttonResult = new TextBlock();
     e_4.Children.Add(buttonResult);
     buttonResult.Name = "buttonResult";
     buttonResult.HorizontalAlignment = HorizontalAlignment.Left;
     Grid.SetColumn(buttonResult, 1);
     Grid.SetRow(buttonResult, 2);
     Binding binding_buttonResult_Text = new Binding("ButtonResult");
     buttonResult.SetBinding(TextBlock.TextProperty, binding_buttonResult_Text);
     // e_6 element
     TextBlock e_6 = new TextBlock();
     e_4.Children.Add(e_6);
     e_6.Name = "e_6";
     e_6.VerticalAlignment = VerticalAlignment.Center;
     e_6.Text = "CheckBox";
//.........这里部分代码省略.........
开发者ID:Mike-EEE,项目名称:UI_Examples,代码行数:101,代码来源:BasicUI.xaml.cs

示例5: Get_TabControl_Items

 private static System.Collections.ObjectModel.ObservableCollection<object> Get_TabControl_Items()
 {
     System.Collections.ObjectModel.ObservableCollection<object> items = new System.Collections.ObjectModel.ObservableCollection<object>();
     // e_3 element
     TabItem e_3 = new TabItem();
     e_3.Name = "e_3";
     e_3.HorizontalContentAlignment = HorizontalAlignment.Stretch;
     e_3.Header = "Controls";
     // e_4 element
     Grid e_4 = new Grid();
     e_3.Content = e_4;
     e_4.Name = "e_4";
     RowDefinition row_e_4_0 = new RowDefinition();
     row_e_4_0.Height = new GridLength(1F, GridUnitType.Auto);
     e_4.RowDefinitions.Add(row_e_4_0);
     RowDefinition row_e_4_1 = new RowDefinition();
     row_e_4_1.Height = new GridLength(1F, GridUnitType.Auto);
     e_4.RowDefinitions.Add(row_e_4_1);
     RowDefinition row_e_4_2 = new RowDefinition();
     row_e_4_2.Height = new GridLength(1F, GridUnitType.Auto);
     e_4.RowDefinitions.Add(row_e_4_2);
     RowDefinition row_e_4_3 = new RowDefinition();
     row_e_4_3.Height = new GridLength(1F, GridUnitType.Auto);
     e_4.RowDefinitions.Add(row_e_4_3);
     RowDefinition row_e_4_4 = new RowDefinition();
     row_e_4_4.Height = new GridLength(1F, GridUnitType.Auto);
     e_4.RowDefinitions.Add(row_e_4_4);
     RowDefinition row_e_4_5 = new RowDefinition();
     row_e_4_5.Height = new GridLength(1F, GridUnitType.Auto);
     e_4.RowDefinitions.Add(row_e_4_5);
     RowDefinition row_e_4_6 = new RowDefinition();
     row_e_4_6.Height = new GridLength(1F, GridUnitType.Auto);
     e_4.RowDefinitions.Add(row_e_4_6);
     RowDefinition row_e_4_7 = new RowDefinition();
     row_e_4_7.Height = new GridLength(1F, GridUnitType.Auto);
     e_4.RowDefinitions.Add(row_e_4_7);
     RowDefinition row_e_4_8 = new RowDefinition();
     row_e_4_8.Height = new GridLength(1F, GridUnitType.Auto);
     e_4.RowDefinitions.Add(row_e_4_8);
     RowDefinition row_e_4_9 = new RowDefinition();
     row_e_4_9.Height = new GridLength(1F, GridUnitType.Auto);
     e_4.RowDefinitions.Add(row_e_4_9);
     RowDefinition row_e_4_10 = new RowDefinition();
     row_e_4_10.Height = new GridLength(1F, GridUnitType.Auto);
     e_4.RowDefinitions.Add(row_e_4_10);
     RowDefinition row_e_4_11 = new RowDefinition();
     row_e_4_11.Height = new GridLength(1F, GridUnitType.Auto);
     e_4.RowDefinitions.Add(row_e_4_11);
     ColumnDefinition col_e_4_0 = new ColumnDefinition();
     col_e_4_0.Width = new GridLength(1F, GridUnitType.Auto);
     e_4.ColumnDefinitions.Add(col_e_4_0);
     ColumnDefinition col_e_4_1 = new ColumnDefinition();
     e_4.ColumnDefinitions.Add(col_e_4_1);
     // e_5 element
     TextBlock e_5 = new TextBlock();
     e_4.Children.Add(e_5);
     e_5.Name = "e_5";
     e_5.VerticalAlignment = VerticalAlignment.Center;
     e_5.Text = "Button";
     // button1 element
     Button button1 = new Button();
     e_4.Children.Add(button1);
     button1.Name = "button1";
     button1.Height = 30F;
     button1.Width = 200F;
     button1.Margin = new Thickness(5F, 5F, 5F, 5F);
     button1.HorizontalAlignment = HorizontalAlignment.Left;
     button1.TabIndex = 1;
     button1.Content = "Button 1";
     button1.CommandParameter = "Click Button 1";
     Grid.SetColumn(button1, 1);
     Grid.SetRow(button1, 0);
     Binding binding_button1_Command = new Binding("ButtonCommand");
     button1.SetBinding(Button.CommandProperty, binding_button1_Command);
     // button2 element
     Button button2 = new Button();
     e_4.Children.Add(button2);
     button2.Name = "button2";
     button2.Height = 30F;
     button2.Width = 200F;
     button2.Margin = new Thickness(5F, 5F, 5F, 5F);
     button2.HorizontalAlignment = HorizontalAlignment.Left;
     button2.TabIndex = 2;
     button2.Content = "Button 2";
     button2.CommandParameter = "Click Button 2";
     Grid.SetColumn(button2, 1);
     Grid.SetRow(button2, 1);
     Binding binding_button2_IsEnabled = new Binding("ButtonEnabled");
     button2.SetBinding(Button.IsEnabledProperty, binding_button2_IsEnabled);
     Binding binding_button2_Command = new Binding("ButtonCommand");
     button2.SetBinding(Button.CommandProperty, binding_button2_Command);
     // buttonResult element
     TextBlock buttonResult = new TextBlock();
     e_4.Children.Add(buttonResult);
     buttonResult.Name = "buttonResult";
     buttonResult.HorizontalAlignment = HorizontalAlignment.Left;
     Grid.SetColumn(buttonResult, 1);
     Grid.SetRow(buttonResult, 2);
     Binding binding_buttonResult_Text = new Binding("ButtonResult");
     buttonResult.SetBinding(TextBlock.TextProperty, binding_buttonResult_Text);
//.........这里部分代码省略.........
开发者ID:EmptyKeys,项目名称:UI_Examples,代码行数:101,代码来源:BasicUI.xaml.cs

示例6: SetupCustomUIElements

            public override void SetupCustomUIElements(dynNodeView nodeUI)
            {
                //add a text box to the input grid of the control
                tb = new TextBox();
                tb.HorizontalAlignment = HorizontalAlignment.Stretch;
                tb.VerticalAlignment = VerticalAlignment.Center;
                nodeUI.inputGrid.Children.Add(tb);
                Grid.SetColumn(tb, 0);
                Grid.SetRow(tb, 0);

                //turn off the border
                var backgroundBrush = new SolidColorBrush(Color.FromArgb(0, 0, 0, 0));
                tb.Background = backgroundBrush;
                tb.BorderThickness = new Thickness(0);

                tb.DataContext = this;
                var bindingSymbol = new Binding("Symbol")
                {
                    Mode = BindingMode.TwoWay,
                    Converter = new StringDisplay()
                };
                tb.SetBinding(TextBox.TextProperty, bindingSymbol);

                tb.TextChanged += tb_TextChanged;
            }
开发者ID:kentvv,项目名称:Dynamo,代码行数:25,代码来源:dynFunction.cs

示例7: ReplaceDirectContent

        public void ReplaceDirectContent()
        {
            DataFormApp_DirectContent dataFormApp = new DataFormApp_DirectContent();
            dataFormApp.dataForm.CurrentItem = new DataClass();
            this.DataFormAppBase = dataFormApp;
            ContentPresenter contentPresenter = null;
            this.AddToPanelAndWaitForLoad();

            this.EnqueueCallback(() =>
            {
                contentPresenter = this.GetTemplatePart<ContentPresenter>("ContentPresenter");
                TextBox textBox = contentPresenter.Content as TextBox;
                Assert.IsNotNull(textBox);
                Assert.AreEqual(dataFormApp.dataForm.Content, textBox);

                this.ExpectContentLoaded();

                textBox = new TextBox();
                textBox.SetBinding(TextBox.TextProperty, new Binding("Age") { Mode = BindingMode.TwoWay });
                DataField dataField = new DataField() { Label = "Age", PropertyPath = "Age", Content = textBox };
                StackPanel stackPanel = new StackPanel();
                stackPanel.Children.Add(dataField);
                dataFormApp.dataForm.Content = stackPanel;
            });

            this.WaitForContentLoaded();

            this.EnqueueCallback(() =>
            {
                Assert.AreEqual(DataFormMode.ReadOnly, dataFormApp.dataForm.Mode);
                contentPresenter = this.GetTemplatePart<ContentPresenter>("ContentPresenter");
                StackPanel stackPanel = contentPresenter.Content as StackPanel;
                Assert.IsNotNull(stackPanel);
                Assert.AreEqual(dataFormApp.dataForm.Content, stackPanel);
            });

            this.EnqueueTestComplete();
        }
开发者ID:shijiaxing,项目名称:SilverlightToolkit,代码行数:38,代码来源:DataFormTests_TemplateDrivenUI.cs

示例8: Target_WhenNotInVisualTree

        public void Target_WhenNotInVisualTree()
        {
            LabelTestPage page = new LabelTestPage();
            this.TestPanel.Children.Add(page);

            this.EnqueueConditional(() => { return page.nameLabel.Initialized; });
            this.EnqueueCallback(() =>
            {
                TextBox tb = new TextBox();
                Binding b = new Binding("Email");
                tb.SetBinding(TextBox.TextProperty, b);
                tb.DataContext = page.DataContext;

                Label fl = new Label();
                fl.Target = tb;
                Assert.AreEqual("Email", fl.Content);
            });
            EnqueueTestComplete();
        }
开发者ID:kvervo,项目名称:HorizontalLoopingSelector,代码行数:19,代码来源:LabelTests.cs

示例9: GenerateEditingElement

		/// <summary>
		/// When overridden in a derived class, gets an editing element that is bound to the column's <see cref="P:System.Windows.Controls.DataGridBoundColumn.Binding"/> property value.
		/// </summary>
		/// <param name="cell">The cell that will contain the generated element.</param>
		/// <param name="dataItem">The data item represented by the row that contains the intended cell.</param>
		/// <returns>
		/// A new editing element that is bound to the column's <see cref="P:System.Windows.Controls.DataGridBoundColumn.Binding"/> property value.
		/// </returns>
		protected override FrameworkElement GenerateEditingElement(DataGridCell cell, object dataItem)
		{
#if !SILVERLIGHT
			_isEditing = false;
#endif
            if(!string.IsNullOrEmpty(Field))
            {
                var codedValueSources = Utilities.DynamicCodedValueSource.GetCodedValueSources(LookupField, FieldInfo, dataItem, DynamicCodedValueSource, nullableSources);
                if (codedValueSources != null)
                {
                    ComboBox box = new ComboBox
                    {
                        Margin = new Thickness(4.0),
                        VerticalAlignment = VerticalAlignment.Center,
                        VerticalContentAlignment = VerticalAlignment.Center,
                        DisplayMemberPath = "DisplayName"
                    };
                    if (!string.IsNullOrEmpty(LookupField) && DynamicCodedValueSource != null)
                    {
                        // Item Source Binding
                        lookupConverter.LookupField = this.LookupField;
                        lookupConverter.Field = this.FieldInfo;
                        lookupConverter.NullableSources = this.nullableSources;
                        Binding binding = new Binding();
                        binding.Mode = BindingMode.OneWay;
                        binding.Converter = lookupConverter;
                        binding.ConverterParameter = DynamicCodedValueSource;
                        box.SetBinding(ComboBox.ItemsSourceProperty, binding);

                        // Selected Item Binding
                        selectedConverter.Field = Field;
                        selectedConverter.LookupField = LookupField;
                        selectedConverter.NullableSources = this.nullableSources;
                        Binding selectedBinding = new Binding();
                        selectedBinding.Mode = BindingMode.OneWay;
                        selectedBinding.Converter = selectedConverter;
                        selectedBinding.ConverterParameter = this.DynamicCodedValueSource;
                        box.SetBinding(ComboBox.SelectedItemProperty, selectedBinding);

                        box.SelectionChanged += box_SelectionChanged;
                    }
                    return box;
                }
                else if(FieldInfo.Type == Client.Field.FieldType.Date)
                {
                    DateTimePicker dtp = new DateTimePicker
                    {
                        Margin = new Thickness(4.0),
                        VerticalAlignment = VerticalAlignment.Center,
                        VerticalContentAlignment = VerticalAlignment.Center,
                        DateTimeFormat = this.DateTimeFormat,
                        DateTimeKind = this.DateTimeKind,
                        Language = cell.Language
                    };
                    
                    Binding selectedBinding =
#if SILVERLIGHT
                    new Binding(Field);
#else
				    new Binding("Attributes["+Field+"]");
					if (FieldDomainUtils.IsDynamicDomain(FieldInfo, LayerInfo))
					{
						selectedBinding.ValidationRules.Add(new DynamicRangeDomainValidationRule()
						{
							ValidationStep = ValidationStep.ConvertedProposedValue,
							Field = FieldInfo,
							LayerInfo = LayerInfo,
							Graphic = dataItem as Graphic
						});
					}
#endif
                    selectedBinding.Mode = BindingMode.TwoWay;
                    selectedBinding.ValidatesOnExceptions = true;
                    selectedBinding.NotifyOnValidationError = true;
                    dtp.SetBinding(DateTimePicker.SelectedDateProperty, selectedBinding);
                    
                    return dtp;
                }
                else
                {
                    TextBox box = new TextBox
                    {
                        Margin = new Thickness(4.0),
                        VerticalAlignment = VerticalAlignment.Center,
                        VerticalContentAlignment = VerticalAlignment.Center,
                    };

                    box.MaxLength = Field.Length;

                    Binding binding =
#if SILVERLIGHT
                    new Binding(Field);
//.........这里部分代码省略.........
开发者ID:adrianph,项目名称:arcgis-toolkit-sl-wpf,代码行数:101,代码来源:FeatureDataGrid.cs

示例10: Get_PlanetInfoTabs_Items

 private static System.Collections.ObjectModel.ObservableCollection<object> Get_PlanetInfoTabs_Items() {
     System.Collections.ObjectModel.ObservableCollection<object> items = new System.Collections.ObjectModel.ObservableCollection<object>();
     // tabInfo element
     TabItem tabInfo = new TabItem();
     tabInfo.Name = "tabInfo";
     tabInfo.Header = "Information";
     // e_94 element
     Grid e_94 = new Grid();
     tabInfo.Content = e_94;
     e_94.Name = "e_94";
     e_94.IsHitTestVisible = false;
     ColumnDefinition col_e_94_0 = new ColumnDefinition();
     col_e_94_0.Width = new GridLength(0.4F, GridUnitType.Star);
     e_94.ColumnDefinitions.Add(col_e_94_0);
     ColumnDefinition col_e_94_1 = new ColumnDefinition();
     col_e_94_1.Width = new GridLength(1F, GridUnitType.Star);
     e_94.ColumnDefinitions.Add(col_e_94_1);
     Binding binding_e_94_DataContext = new Binding("InfoTabData");
     e_94.SetBinding(Grid.DataContextProperty, binding_e_94_DataContext);
     // e_95 element
     StackPanel e_95 = new StackPanel();
     e_94.Children.Add(e_95);
     e_95.Name = "e_95";
     e_95.Orientation = Orientation.Vertical;
     Grid.SetColumn(e_95, 0);
     // e_96 element
     TextBlock e_96 = new TextBlock();
     e_95.Children.Add(e_96);
     e_96.Name = "e_96";
     e_96.Margin = new Thickness(5F, 5F, 0F, 5F);
     Binding binding_e_96_Text = new Binding("PNameText");
     e_96.SetBinding(TextBlock.TextProperty, binding_e_96_Text);
     // e_97 element
     TextBlock e_97 = new TextBlock();
     e_95.Children.Add(e_97);
     e_97.Name = "e_97";
     e_97.Margin = new Thickness(5F, 5F, 0F, 5F);
     Binding binding_e_97_Text = new Binding("PTierText");
     e_97.SetBinding(TextBlock.TextProperty, binding_e_97_Text);
     // e_98 element
     TextBlock e_98 = new TextBlock();
     e_95.Children.Add(e_98);
     e_98.Name = "e_98";
     e_98.Margin = new Thickness(5F, 5F, 0F, 5F);
     Binding binding_e_98_Text = new Binding("PSpeedText");
     e_98.SetBinding(TextBlock.TextProperty, binding_e_98_Text);
     // e_99 element
     TextBlock e_99 = new TextBlock();
     e_95.Children.Add(e_99);
     e_99.Name = "e_99";
     e_99.Margin = new Thickness(5F, 5F, 0F, 5F);
     Binding binding_e_99_Text = new Binding("PDistanceText");
     e_99.SetBinding(TextBlock.TextProperty, binding_e_99_Text);
     // e_100 element
     TextBlock e_100 = new TextBlock();
     e_95.Children.Add(e_100);
     e_100.Name = "e_100";
     e_100.Margin = new Thickness(5F, 5F, 0F, 5F);
     Binding binding_e_100_Text = new Binding("PHabitedText");
     e_100.SetBinding(TextBlock.TextProperty, binding_e_100_Text);
     // e_101 element
     TextBlock e_101 = new TextBlock();
     e_95.Children.Add(e_101);
     e_101.Name = "e_101";
     e_101.Margin = new Thickness(5F, 5F, 0F, 5F);
     Binding binding_e_101_Text = new Binding("PPopulationText");
     e_101.SetBinding(TextBlock.TextProperty, binding_e_101_Text);
     // e_102 element
     TextBlock e_102 = new TextBlock();
     e_95.Children.Add(e_102);
     e_102.Name = "e_102";
     e_102.Margin = new Thickness(5F, 5F, 0F, 5F);
     Binding binding_e_102_Text = new Binding("PPopIncRateText");
     e_102.SetBinding(TextBlock.TextProperty, binding_e_102_Text);
     // e_103 element
     TextBlock e_103 = new TextBlock();
     e_95.Children.Add(e_103);
     e_103.Name = "e_103";
     e_103.Margin = new Thickness(5F, 5F, 0F, 5F);
     Binding binding_e_103_Text = new Binding("POwnerText");
     e_103.SetBinding(TextBlock.TextProperty, binding_e_103_Text);
     // e_104 element
     StackPanel e_104 = new StackPanel();
     e_94.Children.Add(e_104);
     e_104.Name = "e_104";
     e_104.HorizontalAlignment = HorizontalAlignment.Right;
     Grid.SetColumn(e_104, 1);
     // e_105 element
     TextBlock e_105 = new TextBlock();
     e_104.Children.Add(e_105);
     e_105.Name = "e_105";
     e_105.Text = "Map";
     // e_106 element
     Image e_106 = new Image();
     e_104.Children.Add(e_106);
     e_106.Name = "e_106";
     Binding binding_e_106_Source = new Binding("MapImage");
     e_106.SetBinding(Image.SourceProperty, binding_e_106_Source);
     items.Add(tabInfo);
     // tabAdmin element
//.........这里部分代码省略.........
开发者ID:charbean,项目名称:StrategyClean,代码行数:101,代码来源:Root.xaml.cs


注:本文中的TextBox.SetBinding方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。