I'm new to ReactiveUI and currently happy with it. But I have one question: How to handle windows event/message the ReactiveUI way?
In mvvmlight, it's like this:
<Window ...
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:command="http://www.galasoft.ch/mvvmlight">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Closing">
<command:EventToCommand Command="{Binding ClosingCommand}"
PassEventArgsToCommand="True" />
</i:EventTrigger>
</i:Interaction.Triggers>
But I don't know how to do it in ReactiveUI. Maybe it's something similar to
MessageBus.Current.Listen<KeyUpEventArgs>()
.Where(e => e.KeyCode == KeyCode.Up)
.Subscribe(x => Console.WriteLine("Up Pressed!"));
but I don't know how to do it for mainframe's Closing
event specifically.
I have read somewhere that the author of ReactiveUI is not strongly against code behind code (maybe I remember wrong), what's the suggested way then?