These are chat archives for picoe/Eto

23rd
Nov 2017
se5a
@se5a
Nov 23 2017 19:54
hey I've got a strange problem. I'm using a timer (DispatcherTimer) which works in windows, but in linux the event does not apear to get fired. I tried switching to System.Timers.Timer to see if it made any difference, but it's still not firing on linux...
I'm kind of stumped trying to debug this one.
Curtis Wensley
@cwensley
Nov 23 2017 19:56
DispatcherTimer is for WPF and is windows specific. Timer should work, or use Eto's UITimer if it's tied to updating UI.
se5a
@se5a
Nov 23 2017 19:57
that's why I tried system.timers.timer, but seemed to have the same problem. didn't realise eto had a timer, will try that. thanks.
Curtis Wensley
@cwensley
Nov 23 2017 19:58
also, try System.Threading.Timer
if it isn't UI related stuff
se5a
@se5a
Nov 23 2017 19:58
it is ui related, hence wanting to use dispatcherTimer over system.timers.timer
Curtis Wensley
@cwensley
Nov 23 2017 19:58
instead of System.Timers.Timer
ah, UITimer is the equivalent then
se5a
@se5a
Nov 23 2017 20:04
so what makes DispatcherTimer not work on non wpf?
Curtis Wensley
@cwensley
Nov 23 2017 21:59
only WPF uses dispatchers
it being in WindowsBase.dll also gives you a hint that is is windows only
I'm actually surprised that WindowsBase.dll exists on non-windows platforms
assuming you didn't just copy the dll locally
se5a
@se5a
Nov 23 2017 22:01
not that I'm aware of, it's somone elses project that I'm trying to make cross platform.
there are extern calls to kernel32.dll which could be interesting to try finding equivalent way of doing things.
Curtis Wensley
@cwensley
Nov 23 2017 22:04
ah, gotcha. Yeah it does look like it's on mono but I don't know if it actually works.
There might be some trickery that needs to be done to initialize the dispatcher mechanism, but who knows
though the 'standard' cross platform way to invoke stuff is using the SyncrhonizationContext. This is what async/await uses as well afaik.
Curtis Wensley
@cwensley
Nov 23 2017 22:10
why they came up with a totally different way of doing this with WPF totally gets me.
se5a
@se5a
Nov 23 2017 22:11
because MS ;-)
Curtis Wensley
@cwensley
Nov 23 2017 22:35
it's almost like with WPF they reinvented all the core stuff.. events.. INotifyPropertyChanged, UI synchronization