Upfront, this question is related to designing a solution and has no code to share
I am designing a C# desktop application in .net 4.0 (kind of a system monitor) which behaves as below
- Application starts when a user log-in to windows desktop (and only when user islogged in).
- Run at periodic interval through out the users session.
- Shows a system tray icon on users desktop.
- Clicking on the tray icon would open a window which displays some information (with rich user experience)
- Application exists on user log off
- This application may Save its state on start and exist (probably to system registry)
- Needs to access system resources like network and filesystem
My preferences will:
- a windows service running in background which performs the periodic backend operation and network access. This service should also polls information to the front end (UI) which is displayed as alerts in system tray icon (balloon tips)
- a windows application to display information to user – opened by clicking the tray icon
The above considerations are based on my experience with windows application development with .net version 1.1.
However, now I am developing in .net 4.0 and targeting Windows Vista and Windows 7 platforms.
I am not much familiar with the latest trends and my questions are:-
1. I have read that it is not recommended to use windows services which interacts with desktop?
2. Is it recommended to use WPF to develop the UI for this application?
3. Is there any other simple solution or pattern for this?
The service itself should not – but through a client application (listener) it’s fine.
If you need a certain level of UI customization. If visual appeal doesn’t matter, old simple WinForms would be fine.
Databinding features of WPF are superior as well, but it doesn’t make a whole lot of a difference for most simple scenarioes.
A running Windows service plus a client application listening to the service (these options are not mutually exclusive, quite the contrary).