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


C# Button.SetResourceReference方法代码示例

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


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

示例1: Get_TabControl_Items


//.........这里部分代码省略.........
     e_43_Fill_bm.TextureAsset = "Images/MonoGameLogo";
     e_43_Fill.ImageSource = e_43_Fill_bm;
     e_43_Fill.Stretch = Stretch.None;
     e_43.Fill = e_43_Fill;
     e_43.Stroke = new SolidColorBrush(new ColorW(255, 255, 255, 255));
     e_43.StrokeThickness = 1F;
     e_43.RadiusX = 10F;
     e_43.RadiusY = 10F;
     Grid.SetColumn(e_43, 1);
     Grid.SetRow(e_43, 2);
     items.Add(e_32);
     // e_44 element
     TabItem e_44 = new TabItem();
     e_44.Name = "e_44";
     e_44.Header = "Animations";
     // e_45 element
     Grid e_45 = new Grid();
     e_44.Content = e_45;
     e_45.Name = "e_45";
     ColumnDefinition col_e_45_0 = new ColumnDefinition();
     e_45.ColumnDefinitions.Add(col_e_45_0);
     ColumnDefinition col_e_45_1 = new ColumnDefinition();
     e_45.ColumnDefinitions.Add(col_e_45_1);
     // e_46 element
     StackPanel e_46 = new StackPanel();
     e_45.Children.Add(e_46);
     e_46.Name = "e_46";
     // animButton1 element
     Button animButton1 = new Button();
     e_46.Children.Add(animButton1);
     animButton1.Name = "animButton1";
     animButton1.TabIndex = 1;
     animButton1.Content = "Mouse Over me!";
     animButton1.SetResourceReference(Button.StyleProperty, "buttonAnimStyle");
     // animButton2 element
     Button animButton2 = new Button();
     e_46.Children.Add(animButton2);
     animButton2.Name = "animButton2";
     animButton2.TabIndex = 2;
     animButton2.Content = "Mouse Over me!";
     animButton2.SetResourceReference(Button.StyleProperty, "buttonAnimStyle");
     // animButton3 element
     Button animButton3 = new Button();
     e_46.Children.Add(animButton3);
     animButton3.Name = "animButton3";
     animButton3.TabIndex = 3;
     animButton3.Content = "Mouse Over me!";
     animButton3.SetResourceReference(Button.StyleProperty, "buttonAnimStyle");
     // animButton4 element
     Button animButton4 = new Button();
     e_46.Children.Add(animButton4);
     animButton4.Name = "animButton4";
     animButton4.TabIndex = 4;
     animButton4.Content = "Mouse Over me!";
     animButton4.SetResourceReference(Button.StyleProperty, "buttonAnimStyle");
     // animBorder1 element
     Border animBorder1 = new Border();
     e_45.Children.Add(animBorder1);
     animBorder1.Name = "animBorder1";
     animBorder1.Height = 100F;
     animBorder1.Width = 200F;
     animBorder1.Margin = new Thickness(0F, 10F, 0F, 10F);
     animBorder1.VerticalAlignment = VerticalAlignment.Top;
     EventTrigger animBorder1_ET_0 = new EventTrigger(Border.LoadedEvent, animBorder1);
     animBorder1.Triggers.Add(animBorder1_ET_0);
     BeginStoryboard animBorder1_ET_0_AC_0 = new BeginStoryboard();
开发者ID:Mike-EEE,项目名称:UI_Examples,代码行数:67,代码来源:BasicUI.xaml.cs

示例2: Get_TabControl_Items


//.........这里部分代码省略.........
     Grid.SetColumn(e_59, 1);
     Grid.SetRow(e_59, 2);
     // e_60 element
     Image e_60 = new Image();
     e_49.Children.Add(e_60);
     e_60.Name = "e_60";
     Grid.SetColumn(e_60, 2);
     Grid.SetRow(e_60, 2);
     Binding binding_e_60_Source = new Binding("RenderTargetSource");
     e_60.SetBinding(Image.SourceProperty, binding_e_60_Source);
     items.Add(e_48);
     // e_61 element
     TabItem e_61 = new TabItem();
     e_61.Name = "e_61";
     e_61.Header = "Animations";
     // e_62 element
     Grid e_62 = new Grid();
     e_61.Content = e_62;
     e_62.Name = "e_62";
     ColumnDefinition col_e_62_0 = new ColumnDefinition();
     e_62.ColumnDefinitions.Add(col_e_62_0);
     ColumnDefinition col_e_62_1 = new ColumnDefinition();
     e_62.ColumnDefinitions.Add(col_e_62_1);
     // e_63 element
     StackPanel e_63 = new StackPanel();
     e_62.Children.Add(e_63);
     e_63.Name = "e_63";
     // animButton1 element
     Button animButton1 = new Button();
     e_63.Children.Add(animButton1);
     animButton1.Name = "animButton1";
     animButton1.TabIndex = 1;
     animButton1.Content = "Mouse Over me!";
     animButton1.SetResourceReference(Button.StyleProperty, "buttonAnimStyle");
     // animButton2 element
     Button animButton2 = new Button();
     e_63.Children.Add(animButton2);
     animButton2.Name = "animButton2";
     animButton2.TabIndex = 2;
     animButton2.Content = "Mouse Over me!";
     animButton2.SetResourceReference(Button.StyleProperty, "buttonAnimStyle");
     // animButton3 element
     Button animButton3 = new Button();
     e_63.Children.Add(animButton3);
     animButton3.Name = "animButton3";
     animButton3.TabIndex = 3;
     animButton3.Content = "Mouse Over me!";
     animButton3.SetResourceReference(Button.StyleProperty, "buttonAnimStyle");
     // animButton4 element
     Button animButton4 = new Button();
     e_63.Children.Add(animButton4);
     animButton4.Name = "animButton4";
     animButton4.TabIndex = 4;
     animButton4.Content = "Mouse Over me!";
     animButton4.SetResourceReference(Button.StyleProperty, "buttonAnimStyle");
     // animBorder1 element
     Border animBorder1 = new Border();
     e_62.Children.Add(animBorder1);
     animBorder1.Name = "animBorder1";
     animBorder1.Height = 100F;
     animBorder1.Width = 200F;
     animBorder1.Margin = new Thickness(0F, 10F, 0F, 10F);
     animBorder1.VerticalAlignment = VerticalAlignment.Top;
     EventTrigger animBorder1_ET_0 = new EventTrigger(Border.LoadedEvent, animBorder1);
     animBorder1.Triggers.Add(animBorder1_ET_0);
     BeginStoryboard animBorder1_ET_0_AC_0 = new BeginStoryboard();
开发者ID:EmptyKeys,项目名称:UI_Examples,代码行数:67,代码来源:BasicUI.xaml.cs


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