public MainWindow() { InitializeComponent(); EventHub.UiContext = SynchronizationContext.Current; EventHub.Events.Subscribe<ConnectionState>(Callback); ConnectionState state = new ConnectionState("127.0.0.10", 8080); EventHub.Events.Publish<ConnectionState>(state); Console.WriteLine("Finished"); }
public void Callback(ConnectionState state) { Console.WriteLine(state.Address); }