Geeks With Blogs
Hani Amr April 2012 Entries
Playing sounds in WPF
I think playing sounds in a WPF could not be easier than this: using System.Media; SoundPlayer player = new SoundPlayer("Assets/type.wa... player.Play(); And that's it :) ......

Posted On Wednesday, April 25, 2012 9:08 AM

Accessing controls in DataTemplate for Listbox in WPF


I've been searching around on how to access controls that are in DataTemplate for the listbox items in WPF and I came through this post that explained it all in an easy way.


Posted On Wednesday, April 25, 2012 9:05 AM

CSS Hassle for different browsers
Even been into the hassle of an HTML table displaying differently on different browsers ? of course every UI developer have been into it. I've found a very interesting solution to this problem. Suppose that you have a CSS class called "TableLayout" and you want this class to have different attributes according to the client browser. You only need to write it like that in the CSS file: .ie .TableLayout { margin-left: 15px; } .webkit .TableLayout { margin-left: 0px; } This is very simple as it defines ......

Posted On Tuesday, April 24, 2012 11:23 AM

Preventing faulty callbacks to ruin your WCF service
Hello, I had a problem in one of the tasks, that is when using callbacks with WCF service sometimes the callback faults and causes your service to hang or timeout the request. The solution to this was to callback your client in a different thread and catch the exception, and then return it to the application in a nice way. Here's an example for this: private void YourMethod() { //... Do work //Time to callback one of the clients BackgroundWorker workerThread = new BackgroundWorker(); workerThread.DoWork ......

Posted On Tuesday, April 24, 2012 10:54 AM

WPF Notify Icon

Ever wondered how you can create a notify icon that is displayed in task bar and can popup some notifications in your WPF application ? If you do, here's an excellent project that can help you get your task done :).


Posted On Tuesday, April 24, 2012 10:44 AM

WPF Themes
Hello, I was developing the past days a WPF application and I've always dreamed about starting to learn how to create a wonderful looking application with animations and colors that may one day make it look like this famous hospital application that was introduced by the announcement of WPF in every event by Microsoft :) (here's a screenshot of it). So, I may not have reached the same look and nice animations, but I've found a very interesting project on codeplex that can make you theme your application ......

Posted On Tuesday, April 24, 2012 10:42 AM

Set DispatchRuntime.AutomaticInputSessionShutdown to false "WCF Exception"
Hello everyone, Been a while since my last post. I've had a weird exception that causes the WCF service proxy not to respond after a certain time (10 mins I guess), so thanks to this post I figured out the solution. Solution that worked for me was to enable reliable session on the client application's config file and service host's config like this: <reliableSession enabled="true" inactivityTimeout="00:20:00" /> and that lead to increase from 10 mins to 20 hours :) Cheers ......

Posted On Tuesday, April 24, 2012 10:34 AM

Copyright © H@Ni | Powered by: