public MainWindow()
 {
     _viewModel = new ViewModel();
     _viewModel.OnMessage += OnMessage;
     DataContext = _viewModel;
     InitializeComponent();
 }
 public MainWindow()
 {
     this.DataContext = (_viewModel = new ViewModel());
     InitializeComponent();
     _service = new WCFChatServiceClient(new InstanceContext(this));
     _viewModel.Username = "******";
     _viewModel.Connected = false;
     _viewModel.ConnectButtonEnabled = true;
 }