I'm using xSockets to create a simple chat app on windows phone 8, but Im having the following problem, on run it says "does not contain definition for invoke method", I read somewhere that I have to use Dispatch, but also no luck.
My Code:
private async void Connect()
{
Connection = new XSocketClient(ServerURI, Origin, "chat");
chatController = Connection.Controller("chat");
//Handle incoming event from server: use Invoke to write to console from XSocket's thread
chatController.On<string>("addMessage", message => this.Invoke((Action)(() =>
RichTextBoxConsole.Text =(String.Format("{0}" + Environment.NewLine, message))
)));
try
{
Connection.Open();
comboBoxLocation.SelectedIndex = 0;
await chatController.SetProperty("username", UserName);
}
catch
{
StatusText.Text = "Unable to connect to server: Start server before connecting clients.";
No connection: Don't enable Send button or show chat UI
return;
}
}