« first day (1135 days earlier)      last day (3014 days later) » 

11:25 AM
Hello all
I want to figure out how working with multithreading
I read, what if I have one task, then simple way to do it - used BackgroundWorker.
But when I create simple example, elements are still not available.
I think, somewhere a mistake was made.
Maybe, I incorrectly used BackgroundWorker?
Code:
let input() =
    isEnabled.Value <- true
    let backgroundWorker = new BackgroundWorker()
    backgroundWorker.DoWork.AddHandler
        (fun s e -> let arg = e.Argument |> unbox<int>
                    let result = TestText.getText arg
                    e.Result <- result)
    backgroundWorker.RunWorkerCompleted.AddHandler
        (fun s e -> bigtext.Value <- e.Result |> unbox<string>
                    isEnabled.Value <- false)
    backgroundWorker.RunWorkerAsync(count.Value)
    let gettextcommand = self.Factory.CommandSync(input)

    member self.GetTextCommand = gettextcommand
and button in xaml:
<Button Grid.Row="0" Margin="3" Content="GetText" Command="{Binding GetTextCommand}" HorizontalAlignment="Right"></Button>
input and gettextcommand have different indentation - error is not in them =)
 

« first day (1135 days earlier)      last day (3014 days later) »