Hi
Am new to wpf and C#, so any comments are big welcome.
I am trying build a wpf form, and two issues for now,
The wpf form need a input from parents like
MainWindow("This is inout string")
so my 1st question, I don’t know the easy way to pass this to the form.
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
InitializeTextBox();
}
public MainWindow(string RunType)
{
InitializeComponent();
versionDescribtionTextBox.Text = RunType;
}
}
2nd I've tried this bit code, and hopefully works, but once I tried run the wpf from a console apps, it has following error : The calling thread must be STA, because many UI components require this.
static void Main()
{
System.Windows.Application app = new System.Windows.Application();
app.Run(new WpfApplication1.MainWindow("This is inout string"));
}
Thanks a lot