I started programming just few month ago so I am a pure beginner but I needed a math app with Heavy probability calculation and an UI to view/interact so I searched around and found C#.net was the best way... fantastic power...
It will help me a lot to progress if I am able do this :
Wpf window with textbox, in textbox a number is printed each time the calculation is done but the Ui should respond everytime
I tried to do it using latest net 4.5 because the app need to be fast (so use the most recent tech and not timer or background task)
and it work but the Ui is stuck and cannot move (because of my bad access to the text box I think)
If guys could help me it will be great and I thank you all because I learned a lot with your posts!
Here is my wrong newbie code
private Random rng; public MainWindow() { rng = new Random(); InitializeComponent(); Task.Run((Func<Task>) Calc); } private async Task Calc() { while (true) { textBox1.Dispatcher.Invoke (DispatcherPriority.Normal , new Action(delegate() { textBox1.Text = rng.NextDouble().ToString(); } ) ); } }