本文整理汇总了C#中Slider.SetBinding方法的典型用法代码示例。如果您正苦于以下问题:C# Slider.SetBinding方法的具体用法?C# Slider.SetBinding怎么用?C# Slider.SetBinding使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Slider
的用法示例。
在下文中一共展示了Slider.SetBinding方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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";
//.........这里部分代码省略.........
示例2: 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);
//.........这里部分代码省略.........
示例3: Get_e_24_Items
private static System.Collections.ObjectModel.ObservableCollection<object> Get_e_24_Items() {
System.Collections.ObjectModel.ObservableCollection<object> items = new System.Collections.ObjectModel.ObservableCollection<object>();
// e_25 element
TabItem e_25 = new TabItem();
e_25.Name = "e_25";
e_25.HorizontalContentAlignment = HorizontalAlignment.Stretch;
e_25.SetResourceReference(TabItem.HeaderProperty, "GameText");
// e_26 element
Grid e_26 = new Grid();
e_25.Content = e_26;
e_26.Name = "e_26";
e_26.Margin = new Thickness(10F, 10F, 10F, 10F);
RowDefinition row_e_26_0 = new RowDefinition();
row_e_26_0.Height = new GridLength(1F, GridUnitType.Auto);
e_26.RowDefinitions.Add(row_e_26_0);
RowDefinition row_e_26_1 = new RowDefinition();
row_e_26_1.Height = new GridLength(1F, GridUnitType.Auto);
e_26.RowDefinitions.Add(row_e_26_1);
RowDefinition row_e_26_2 = new RowDefinition();
row_e_26_2.Height = new GridLength(1F, GridUnitType.Auto);
e_26.RowDefinitions.Add(row_e_26_2);
RowDefinition row_e_26_3 = new RowDefinition();
row_e_26_3.Height = new GridLength(1F, GridUnitType.Auto);
e_26.RowDefinitions.Add(row_e_26_3);
RowDefinition row_e_26_4 = new RowDefinition();
row_e_26_4.Height = new GridLength(1F, GridUnitType.Auto);
e_26.RowDefinitions.Add(row_e_26_4);
ColumnDefinition col_e_26_0 = new ColumnDefinition();
col_e_26_0.Width = new GridLength(58F, GridUnitType.Star);
e_26.ColumnDefinitions.Add(col_e_26_0);
ColumnDefinition col_e_26_1 = new ColumnDefinition();
col_e_26_1.Width = new GridLength(134F, GridUnitType.Star);
e_26.ColumnDefinitions.Add(col_e_26_1);
ColumnDefinition col_e_26_2 = new ColumnDefinition();
col_e_26_2.Width = new GridLength(193F, GridUnitType.Star);
e_26.ColumnDefinitions.Add(col_e_26_2);
ColumnDefinition col_e_26_3 = new ColumnDefinition();
col_e_26_3.Width = new GridLength(192F, GridUnitType.Star);
e_26.ColumnDefinitions.Add(col_e_26_3);
ColumnDefinition col_e_26_4 = new ColumnDefinition();
col_e_26_4.Width = new GridLength(193F, GridUnitType.Star);
e_26.ColumnDefinitions.Add(col_e_26_4);
// e_27 element
TextBlock e_27 = new TextBlock();
e_26.Children.Add(e_27);
e_27.Name = "e_27";
e_27.Margin = new Thickness(0F, 6F, 0F, 5F);
e_27.VerticalAlignment = VerticalAlignment.Center;
e_27.Foreground = new SolidColorBrush(new ColorW(255, 255, 255, 255));
Grid.SetColumnSpan(e_27, 2);
e_27.SetResourceReference(TextBlock.TextProperty, "DifficultyText");
// cbDifficulty element
ComboBox cbDifficulty = new ComboBox();
e_26.Children.Add(cbDifficulty);
cbDifficulty.Name = "cbDifficulty";
cbDifficulty.Margin = new Thickness(2F, 2F, 2F, 3F);
cbDifficulty.VerticalAlignment = VerticalAlignment.Center;
cbDifficulty.ItemsSource = Get_cbDifficulty_Items();
Grid.SetColumn(cbDifficulty, 2);
Binding binding_cbDifficulty_SelectedIndex = new Binding("Difficulty");
cbDifficulty.SetBinding(ComboBox.SelectedIndexProperty, binding_cbDifficulty_SelectedIndex);
// e_31 element
TextBlock e_31 = new TextBlock();
e_26.Children.Add(e_31);
e_31.Name = "e_31";
e_31.Margin = new Thickness(0F, 6F, 0F, 5F);
e_31.VerticalAlignment = VerticalAlignment.Center;
e_31.Foreground = new SolidColorBrush(new ColorW(255, 255, 255, 255));
Grid.SetRow(e_31, 1);
Grid.SetColumnSpan(e_31, 2);
e_31.SetResourceReference(TextBlock.TextProperty, "LanguageText");
// cbLanguage element
ComboBox cbLanguage = new ComboBox();
e_26.Children.Add(cbLanguage);
cbLanguage.Name = "cbLanguage";
cbLanguage.Margin = new Thickness(2F, 3F, 2F, 2F);
cbLanguage.VerticalAlignment = VerticalAlignment.Center;
cbLanguage.ItemsSource = Get_cbLanguage_Items();
Grid.SetColumn(cbLanguage, 2);
Grid.SetRow(cbLanguage, 1);
Binding binding_cbLanguage_SelectedIndex = new Binding("Language");
cbLanguage.SetBinding(ComboBox.SelectedIndexProperty, binding_cbLanguage_SelectedIndex);
items.Add(e_25);
// e_36 element
TabItem e_36 = new TabItem();
e_36.Name = "e_36";
e_36.SetResourceReference(TabItem.HeaderProperty, "VideoText");
// e_37 element
Grid e_37 = new Grid();
e_36.Content = e_37;
e_37.Name = "e_37";
e_37.Margin = new Thickness(10F, 10F, 10F, 10F);
RowDefinition row_e_37_0 = new RowDefinition();
row_e_37_0.Height = new GridLength(1F, GridUnitType.Auto);
e_37.RowDefinitions.Add(row_e_37_0);
RowDefinition row_e_37_1 = new RowDefinition();
row_e_37_1.Height = new GridLength(1F, GridUnitType.Auto);
e_37.RowDefinitions.Add(row_e_37_1);
RowDefinition row_e_37_2 = new RowDefinition();
row_e_37_2.Height = new GridLength(1F, GridUnitType.Auto);
//.........这里部分代码省略.........
示例4: 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
//.........这里部分代码省略.........