These are chat archives for AvaloniaUI/Avalonia

Aug 2016
Ivan Kochurkin
Aug 29 2016 11:28
Hi! How can I ObserveOnDispatcher in Avalonia?
I want to update UI from another thread.
I can use Dispatcher.UIThread.InvokeAsync( but it is not clear solution.
If I use ObserveOnDispatcher code throws an exception: An exception of type 'System.InvalidOperationException' occurred in System.Reactive.Windows.Threading.dll but was not handled in user code
Andrey Kunchev
Aug 29 2016 11:31
@KvanTTT you make it in a few different ways. using Observe on Scheduler and using a scheduler from AvaloniaScheduler.Instance, RxApp.MainThreadScheduler
Aug 29 2016 11:35
@KvanTTT iv been using await Dispatcher.UiThread.InvokeTaskAsync
Seems to work well, im not aware of the other ways to do it
Thats the avalonia built in way to do it
Probably it crashes because that part of Rx might not have been ported yet
Ivan Kochurkin
Aug 29 2016 11:39
@donandren It seems to me that this code working:
ev => _workflow.StateChanged += ev, ev => _workflow.StateChanged -= ev)
.Subscribe(ev =>
    CurrentState = ev.EventArgs.Stage.ToString();
But I guess ObserveOnDispatcher method should works too.
@danwalmsley it is not very clear to write Dispatcher.UIThread.InvokeAsync(() => everywhere.
Aug 29 2016 11:45
yeah I agree
Steven Kirk
Aug 29 2016 21:24
ok, i'm back!
still struggling to get used to being in front of a computer tho
Steven Kirk
Aug 29 2016 21:37
btw if anyone's interested, our team at GH are hiring for a developer for the VS plugin:
send me a PM if you apply
Darnell Williams
Aug 29 2016 23:30
Man i wanna do it toooo but no degree or professional experience
This is epic, I wanna really do this now