public ClientViewModel() { _netClient = new NetClient(_IP, _Port); _CommandControler = new Commands(); _backgroundHelper = new BackgroundConnectionHelper(new DoWorkEventHandler(OnCallBack), new RunWorkerCompletedEventHandler(UpdateGUI)); _ConnectClick = new CommandAction(StartClientClick); }
public void StartClientClick() { _netClient.Dispose(); _netClient = new NetClient(_IP, _Port); _netClient.Connect(); _backgroundHelper.Start(); RaisePropertyChanged("Connection"); }