public static Button CreateCloseButton()
 {
     Button closeButton = new Button();
     closeButton.Content = "X";
     closeButton.Width = 20;
     closeButton.Height = 19;
     closeButton.FontFamily = new FontFamily("Courier");
     closeButton.FontSize = 12;
     closeButton.FontWeight = (FontWeight) new FontWeightConverter().ConvertFromString("Bold");
     closeButton.HorizontalAlignment = HorizontalAlignment.Right;
     closeButton.VerticalAlignment = VerticalAlignment.Top;
     closeButton.Style = (Style) closeButton.FindResource(ToolBar.ButtonStyleKey);
     closeButton.Margin = new Thickness(3, 0, 0, 0);
     return closeButton;
 }
示例#2
0
 private void Animate(Button butt, string key) => butt.BeginStoryboard((Storyboard) butt.FindResource(key));