private void DoLogin()
        {
            IsLoginButtonPressed = true;
            if (LoginData == null) return;

            WebClient webClient = new WebClient();
            webClient.Headers.Add("uid", LoginData.LoginName);
            webClient.Headers.Add("pass", LoginData.Password);
            webClient.Headers.Add("logonType", "0");
            GenericWeakReference<WebClient> weakClient = new GenericWeakReference<WebClient>(webClient);

            var eventStream = Observable.FromEventPattern<DownloadDataCompletedEventArgs>(weakClient.Target, "DownloadDataCompleted").
                                SubscribeOn(Scheduler.NewThread).Select(newData => newData.EventArgs.Result);

            subscription = eventStream.ObserveOn(System.Threading.SynchronizationContext.Current).Subscribe(OnDatareceived,
                //on error
                ex =>
                {
                    if (ex is AggregateException)
                        System.Windows.MessageBox.Show((ex as AggregateException).Flatten().Message);
                    else
                        System.Windows.MessageBox.Show(ex.Message);
                    ViewModel.ViewModelLocator.Logger.Error(string.Empty, ex);
                });

            webClient.DownloadDataAsync(new Uri(ConfigurationManager.AppSettings["loginUrl"]));
            weakClient.Dispose();
            weakClient = null;
        }