public OneWaySessionMigrationViewModel(OneWaySessionViewModel oneWaySession) { m_oneWaySession = oneWaySession; m_backgroundWorker = new BackgroundWorker(); m_backgroundWorker.DoWork += new DoWorkEventHandler(m_backgroundWorker_DoWork); Attach(); Refresh(); }
public OneWaySessionHistoryViewModel(OneWaySessionViewModel oneWaySession) { m_context = RuntimeEntityModel.CreateInstance(); m_dispatcher = Dispatcher.CurrentDispatcher; m_oneWaySession = oneWaySession; m_worker = new BackgroundWorker(); m_worker.WorkerReportsProgress = true; m_worker.DoWork += new DoWorkEventHandler(m_worker_DoWork); m_worker.ProgressChanged += new ProgressChangedEventHandler(m_worker_ProgressChanged); m_worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(m_worker_RunWorkerCompleted); RuntimeManager runtimeManager = RuntimeManager.GetInstance(); IRefreshService refresh = (IRefreshService)runtimeManager.GetService(typeof(IRefreshService)); refresh.AutoRefresh += this.AutoRefresh; }