TextBox Binding TwoWay Doesn’t Update Until Focus Lost WP7

I assume your Save button is an ApplicationBarButton (not a normal button). For normal buttons it will just work because they take focus and hence the data-binding will kick in. For ApplicationBarButtons on the phone it’s a little different because they don’t take focus away from the client app. To ensure the data-binding kicks in … Read more

Parsing HTML with c#.net [duplicate]

Give the HTMLAgilityPack a look into. Its a pretty decent HTML parser http://html-agility-pack.net/?z=codeplex Here’s some code to get you started (requires error checking) HtmlDocument document = new HtmlDocument(); string htmlString = “<html>blabla</html>”; document.LoadHtml(htmlString); HtmlNodeCollection collection = document.DocumentNode.SelectNodes(“//a”); foreach (HtmlNode link in collection) { string target = link.Attributes[“href”].Value; }

How to POST request using RestSharp

My RestSharp POST method: var client = new RestClient(ServiceUrl); var request = new RestRequest(“/resource/”, Method.POST); // Json to post. string jsonToSend = JsonHelper.ToJson(json); request.AddParameter(“application/json; charset=utf-8”, jsonToSend, ParameterType.RequestBody); request.RequestFormat = DataFormat.Json; try { client.ExecuteAsync(request, response => { if (response.StatusCode == HttpStatusCode.OK) { // OK } else { // NOK } }); } catch (Exception error) { … Read more

Return Task instantly

in .NET 4.5 you can use FromResult to immediately return a result for your task. public Task<bool> MyTask() { return TaskEx.FromResult(false); } http://msdn.microsoft.com/en-us/library/hh228607%28v=vs.110%29.aspx For Windows Phone 8.1 and higher, the API has been merged to be consistent with other platforms: public Task<bool> MyTask() { return Task.FromResult(false); }

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)