I´ve set up business logic handling a connection of a clientsoftware to a serversoftware. That BL is encapsulated in this interface:
public interface IServerConnectionLogic
{
IObservable Connected { get; }
Task Connect();
...
}
Connect());
In my viewmodel (based on ReactiveObject) I create my commands, that should trigger the server-connection:
CmdConnectToService = new ReactiveCommand(ServerConnectionLogic.Connected.Select(connected => !connected));
CmdConnectToService.Subscribe(_ => ServerConnectionLogic.Connect());
The command is bound to a button in my UI-XAML. When pressing the button the subscribed lamda is hit and the "Connect" method is called. Inside the Observable "Connected" is set to "true. Also the lambda in the "CanExecute"-parameter of the constructor of the ReactiveCommand is hit. But the UI is not updated. I would have expected the button to get disabled, sinde the observable "Connected" turns to "true" and the "Select" statement inverts my boolean value... I´ve tried that with the "RibbonButton" from the WpfToolkit as well as with a "normal" Button. Both are not getting updated. The same IObservable is also bound to a member field:
m_ServerConnected = new ObservableAsPropertyHelper(ServerConnectionLogic.Connected, _ => raisePropertyChanged("ServerConnected"));
while "m_ServerConnected" is bound to a CheckBox (for testing) via a property. That one is working fine, so the observable must be working... Does anyone have an idea what could be my issue?