Example #1
0
        public void OnStartUp(object sender, StartupEventArgs e)
        {
            ClientMainWindow view = new ClientMainWindow();

            Models.ClientModel clientModel = new Models.ClientModel();

            view.DataContext = new ClientViewModel(clientModel);

            view.Show();
        }
        public ClientViewModel(ClientModel clientModel)
        {
            LoadConfig();
            
            _clientModel = clientModel;
            _clientModel.MessageReceived += OnMessageDataReceived;
            _clientModel.UserNameChanged += OnUserNameChanged;
            _clientModel.DownloadFileRequest += OnDownloadRequest;
            _clientModel.OnLogin += OnLogin;

            BindingOperations.EnableCollectionSynchronization(UserMessages, _userMessagesLock);

            InitCommands();
        }