using System.Windows;
using System.Windows.Controls;
namespace Test1
{
public partial class MainWindow : Window
{
public myButtonClass ttt = new myButtonClass();
public MainWindow()
{
InitializeComponent();
// как вывести кнопку ttt на форму???
}
}
public class myButtonClass
{
public Button newButton;
public myButtonClass()
{
newButton = new Button();
newButton.Content = "press me";
newButton.Height = 50;
newButton.Width = 50;
newButton.Margin = new Thickness(50, 50, 0, 0);
newButton.IsEnabled = true;
}
}
}
Grid
, то по-моему вот так (this.Content as Grid).Children.Add(button);
public class myButtonClass