C# WPF Application to configure server
Hi everyone,
Currently for a university project I am building a server that can send notifications to a mobile device. Part of the project involves building a front end where I can configure everything for the server - updates to send, rules and so on. On the front end I have a button to Start or Stop the server - "Start" begins a BackgroundWorker that creates and starts the server (the server is a .dll kept in a separate project, the server is a private variable in my MainWindowViewModel).
Is this the correct way to handle this? If I start the server without the BackgroundWorker the whole application freezes until the server has returned from it's "startUpdating" method, but is a BackgroundWorker the right way, or should I be starting up a new Thread?
I'm new to WPF so forgive me if this is a stupid question!
SCass2010
Junior Poster in Training
92 posts since Mar 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Ah right, so using the BackgroundWorker I'm actually creating the server on a separate thread from the UI? I have the BackgroundWorker linked up to a ProgressChanged event (simple one, just increases a ProgressBar by a bit for each part that has been set up).
Would I be better just having the BackgroundWorker creating a new instance of the server, or using the private instance from the ViewModel or would it not really make a difference either way?
SCass2010
Junior Poster in Training
92 posts since Mar 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0